// Path: src/test/java/com/github/hgwood/fanfaron/TestUtils.java
// public static <T> T deserialize(Class<?> parentOfResource, String resourcePath, Class<T> targetClass) {
//     URL resourceUrl = parentOfResource.getResource(resourcePath);
//     requireNonNull(resourceUrl, format("resource '%s' of class '%s' not found", resourcePath, parentOfResource.getCanonicalName()));
//     try {
//         return objectMapper.readValue(resourceUrl, targetClass);
//     } catch (IOException e) {
//         throw new RuntimeException(e);
//     }
// }


import org.junit.Test;
import static com.github.hgwood.fanfaron.TestUtils.deserialize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
package com.github.hgwood.fanfaron;



public class ArrayItemsTest {

    @Test public void items_accepts_an_array_value() {
        Schema schema = deserialize(getClass(), "arrayItems.json", Schema.class);
        assertEquals(2, schema.items.schemas.size());
        assertNull(schema.items.schema);
    }

    @Test public void items_accepts_an_schema_value() {
        Schema schema = deserialize(getClass(), "schemaItems.json", Schema.class);
// Path: src/test/java/com/github/hgwood/fanfaron/TestUtils.java
// public static <T> T deserialize(Class<?> parentOfResource, String resourcePath, Class<T> targetClass) {
//     URL resourceUrl = parentOfResource.getResource(resourcePath);
//     requireNonNull(resourceUrl, format("resource '%s' of class '%s' not found", resourcePath, parentOfResource.getCanonicalName()));
//     try {
//         return objectMapper.readValue(resourceUrl, targetClass);
//     } catch (IOException e) {
//         throw new RuntimeException(e);
//     }
// }


// Path: src/test/java/com/github/hgwood/fanfaron/ArrayItemsTest.java
import org.junit.Test;
import static com.github.hgwood.fanfaron.TestUtils.deserialize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

package com.github.hgwood.fanfaron;



public class ArrayItemsTest {

    @Test public void items_accepts_an_array_value() {
        Schema schema = deserialize(getClass(), "arrayItems.json", Schema.class);
        assertEquals(2, schema.items.schemas.size());
        assertNull(schema.items.schema);
    }

    @Test public void items_accepts_an_schema_value() {
        Schema schema = deserialize(getClass(), "schemaItems.json", Schema.class);
        assertNotNull(schema.items.schema);