// Path: integration-test-java/src/test/java/verification/Utils.java
// public final class Utils {
// 
//     private Utils() {
//     }
// 
//     private static <T> TypeAdapter<T> getTypeAdapter(@NotNull Class<T> clazz) {
//         Gson gson = new Gson();
//         Stag.Factory factory = new Stag.Factory();
//         TypeToken<T> innerModelType = TypeToken.get(clazz);
//         return factory.create(gson, innerModelType);
//     }
// 
//     /**
//      * Verifies that a TypeAdapter was generated for the specified class.
//      *
//      * @param clazz the class to check.
//      * @param <T>   the type of the class, used internally.
//      */
//     public static <T> void verifyTypeAdapterGeneration(@NotNull Class<T> clazz) {
//         TypeAdapter<T> typeAdapter = getTypeAdapter(clazz);
//         assertNotNull("Type adapter should have been generated by Stag", typeAdapter);
//     }
// 
//     /**
//      * Verifies that a TypeAdapter was NOT generated for the specified class.
//      *
//      * @param clazz the class to check.
//      * @param <T>   the type of the class, used internally.
//      */
//     public static <T> void verifyNoTypeAdapterGeneration(@NotNull Class<T> clazz) {
//         TypeAdapter<T> typeAdapter = getTypeAdapter(clazz);
//         assertNull("Type adapter should not have been generated by Stag", typeAdapter);
//     }
// 
//     /**
//      * Verifies that the type adapter for a class is correct. It does this by manufacturing an
//      * instance of the class, writing it to JSON, and then reading that object back out of JSON
//      * and comparing the two instances.
//      *
//      * @param clazz the {@link Class} to use to get the {@link TypeAdapter}.
//      */
//     public static <T> void verifyTypeAdapterCorrectness(@NotNull Class<T> clazz) {
//         final PodamFactory factory = new PodamFactoryImpl();
//         factory.setClassStrategy(new HungarianNotationClassInfoStrategy());
// 
//         final T object = factory.manufacturePojo(clazz);
//         final TypeAdapter<T> typeAdapter = getTypeAdapter(clazz);
//         
//         T newObject = null;
//         if (typeAdapter != null) {
//             final String json = typeAdapter.toJson(object);
//             try {
//                 newObject = typeAdapter.fromJson(json);
//             } catch (IOException ignored) {}
//         }
// 
//         assertEquals(object, newObject);
//     }
// 
// }


import org.junit.Test;
import verification.Utils;
package com.vimeo.sample_java_model;



/**
 * Created by restainoa on 2/3/17.
 */
public class ModelWithNestedInterfaceTest {

    @Test
    public void typeAdapterWasGenerated_ModelWithNestedInterface() throws Exception {
        Utils.verifyTypeAdapterGeneration(ModelWithNestedInterface.class);
    }

    @Test
    public void typeAdapterWasNotGenerated_ModelWithNestedInterface_NestedInterface() throws Exception {
        Utils.verifyNoTypeAdapterGeneration(ModelWithNestedInterface.NestedInterface.class);
    }

    @Test
    public void typeAdapterWasNotGenerated_ModelWithNestedInterface_NestedInterface_NestedModel()
            throws Exception {
// Path: integration-test-java/src/test/java/verification/Utils.java
// public final class Utils {
// 
//     private Utils() {
//     }
// 
//     private static <T> TypeAdapter<T> getTypeAdapter(@NotNull Class<T> clazz) {
//         Gson gson = new Gson();
//         Stag.Factory factory = new Stag.Factory();
//         TypeToken<T> innerModelType = TypeToken.get(clazz);
//         return factory.create(gson, innerModelType);
//     }
// 
//     /**
//      * Verifies that a TypeAdapter was generated for the specified class.
//      *
//      * @param clazz the class to check.
//      * @param <T>   the type of the class, used internally.
//      */
//     public static <T> void verifyTypeAdapterGeneration(@NotNull Class<T> clazz) {
//         TypeAdapter<T> typeAdapter = getTypeAdapter(clazz);
//         assertNotNull("Type adapter should have been generated by Stag", typeAdapter);
//     }
// 
//     /**
//      * Verifies that a TypeAdapter was NOT generated for the specified class.
//      *
//      * @param clazz the class to check.
//      * @param <T>   the type of the class, used internally.
//      */
//     public static <T> void verifyNoTypeAdapterGeneration(@NotNull Class<T> clazz) {
//         TypeAdapter<T> typeAdapter = getTypeAdapter(clazz);
//         assertNull("Type adapter should not have been generated by Stag", typeAdapter);
//     }
// 
//     /**
//      * Verifies that the type adapter for a class is correct. It does this by manufacturing an
//      * instance of the class, writing it to JSON, and then reading that object back out of JSON
//      * and comparing the two instances.
//      *
//      * @param clazz the {@link Class} to use to get the {@link TypeAdapter}.
//      */
//     public static <T> void verifyTypeAdapterCorrectness(@NotNull Class<T> clazz) {
//         final PodamFactory factory = new PodamFactoryImpl();
//         factory.setClassStrategy(new HungarianNotationClassInfoStrategy());
// 
//         final T object = factory.manufacturePojo(clazz);
//         final TypeAdapter<T> typeAdapter = getTypeAdapter(clazz);
//         
//         T newObject = null;
//         if (typeAdapter != null) {
//             final String json = typeAdapter.toJson(object);
//             try {
//                 newObject = typeAdapter.fromJson(json);
//             } catch (IOException ignored) {}
//         }
// 
//         assertEquals(object, newObject);
//     }
// 
// }


// Path: integration-test-java/src/test/java/com/vimeo/sample_java_model/ModelWithNestedInterfaceTest.java
import org.junit.Test;
import verification.Utils;

package com.vimeo.sample_java_model;



/**
 * Created by restainoa on 2/3/17.
 */
public class ModelWithNestedInterfaceTest {

    @Test
    public void typeAdapterWasGenerated_ModelWithNestedInterface() throws Exception {
        Utils.verifyTypeAdapterGeneration(ModelWithNestedInterface.class);
    }

    @Test
    public void typeAdapterWasNotGenerated_ModelWithNestedInterface_NestedInterface() throws Exception {
        Utils.verifyNoTypeAdapterGeneration(ModelWithNestedInterface.NestedInterface.class);
    }

    @Test
    public void typeAdapterWasNotGenerated_ModelWithNestedInterface_NestedInterface_NestedModel()
            throws Exception {
        Utils.verifyNoTypeAdapterGeneration(ModelWithNestedInterface.NestedInterface.NestedModel.class);