// Path: src/test/java/pl/zientarski/TestUtils.java
// public static Set<String> toStringSet(final JSONArray jsonArray) {
//     final Set<String> result = new HashSet<>();
//     for (int i = 0; i < jsonArray.length(); i++) {
//         result.add(jsonArray.getString(i));
//     }
//     return result;
// }


import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import java.util.Set;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static pl.zientarski.TestUtils.toStringSet;
package pl.zientarski;




public class EnumTest {
    private SchemaMapper mapper;

    enum HangarType {
        SMALL,
        MEDIUM,
        BIG
    }

    @Before
    public void before() {
        mapper = new SchemaMapper();
    }

    @Test
    public void enumPropertyTest() throws Exception {
        //given

        //when
        final JSONObject schema = mapper.toJsonSchema4(HangarType.class);

        //then
        assertTrue(schema.has("enum"));
    }

    @Test
    public void enumElementsTest() throws Exception {
        //given

        //when
        final JSONObject schema = mapper.toJsonSchema4(HangarType.class);

        //then
        final JSONArray hangarTypes = schema.getJSONArray("enum");
// Path: src/test/java/pl/zientarski/TestUtils.java
// public static Set<String> toStringSet(final JSONArray jsonArray) {
//     final Set<String> result = new HashSet<>();
//     for (int i = 0; i < jsonArray.length(); i++) {
//         result.add(jsonArray.getString(i));
//     }
//     return result;
// }


// Path: src/test/java/pl/zientarski/EnumTest.java
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import java.util.Set;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static pl.zientarski.TestUtils.toStringSet;

package pl.zientarski;




public class EnumTest {
    private SchemaMapper mapper;

    enum HangarType {
        SMALL,
        MEDIUM,
        BIG
    }

    @Before
    public void before() {
        mapper = new SchemaMapper();
    }

    @Test
    public void enumPropertyTest() throws Exception {
        //given

        //when
        final JSONObject schema = mapper.toJsonSchema4(HangarType.class);

        //then
        assertTrue(schema.has("enum"));
    }

    @Test
    public void enumElementsTest() throws Exception {
        //given

        //when
        final JSONObject schema = mapper.toJsonSchema4(HangarType.class);

        //then
        final JSONArray hangarTypes = schema.getJSONArray("enum");
        assertThat(hangarTypes.length(), equalTo(3));