// Path: app/src/main/java/io/rapidpro/surveyor/utils/RawJson.java
// public class RawJson {
//     private String data;
// 
//     public RawJson(String data) {
//         this.data = data;
//     }
// 
//     @Override
//     public String toString() {
//         return this.data;
//     }
// 
//     /**
//      * Type adapter to tell Gson how to use fields of this type
//      */
//     public static class Adapter extends TypeAdapter<RawJson> {
//         @Override
//         public void write(JsonWriter out, RawJson value) throws IOException {
//             out.jsonValue(value.toString());
//         }
// 
//         @Override
//         public RawJson read(JsonReader in) throws IOException {
//             // TODO ideally this wouldn't parse the entire tree into memory
//             // see https://github.com/google/gson/issues/1368
//             JsonElement parsed = new JsonParser().parse(in);
// 
//             return new RawJson(parsed.toString());
//         }
//     }
// }


import org.apache.commons.io.FileUtils;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import io.rapidpro.surveyor.utils.RawJson;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
package io.rapidpro.surveyor.data;





public class FlowTest {

    @Test
    public void extractV13() throws IOException {
        File flow = new File(FlowTest.class.getClassLoader().getResource("flows/two_questions_v13.json").getPath());
        String definition = FileUtils.readFileToString(flow);

// Path: app/src/main/java/io/rapidpro/surveyor/utils/RawJson.java
// public class RawJson {
//     private String data;
// 
//     public RawJson(String data) {
//         this.data = data;
//     }
// 
//     @Override
//     public String toString() {
//         return this.data;
//     }
// 
//     /**
//      * Type adapter to tell Gson how to use fields of this type
//      */
//     public static class Adapter extends TypeAdapter<RawJson> {
//         @Override
//         public void write(JsonWriter out, RawJson value) throws IOException {
//             out.jsonValue(value.toString());
//         }
// 
//         @Override
//         public RawJson read(JsonReader in) throws IOException {
//             // TODO ideally this wouldn't parse the entire tree into memory
//             // see https://github.com/google/gson/issues/1368
//             JsonElement parsed = new JsonParser().parse(in);
// 
//             return new RawJson(parsed.toString());
//         }
//     }
// }


// Path: app/src/test/java/io/rapidpro/surveyor/data/FlowTest.java
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import io.rapidpro.surveyor.utils.RawJson;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

package io.rapidpro.surveyor.data;





public class FlowTest {

    @Test
    public void extractV13() throws IOException {
        File flow = new File(FlowTest.class.getClassLoader().getResource("flows/two_questions_v13.json").getPath());
        String definition = FileUtils.readFileToString(flow);

        Flow summary = Flow.extract(new RawJson(definition));