test/src/kbasesearchengine/test/parse/ObjectParserTest.java
@Test
    public void parseObjectsModelTest() throws Exception {

        final String jsonResource = "fbamodel01";
        final String type = "FBAModel";
        final String guid = "WS:1/1/1";

        final Map<GUID, String> guidToJson = parseSubObjects(type, jsonResource, guid);

        assertThat(guidToJson.size(), is(1));
        final String jsonString = guidToJson.values().iterator().next();
        @SuppressWarnings("unchecked")
        HashMap<String, Object> result = new ObjectMapper().readValue(jsonString, HashMap.class);

        HashMap<String, Object> expectedResult = new HashMap<String, Object>();
        expectedResult.put("id", "rast_test");
        expectedResult.put("source", "KBase");
        expectedResult.put("modelcompartments", 2);
        expectedResult.put("modelcompounds", 3);
        expectedResult.put("modelreactions", 3);
        expectedResult.put("name", "E. coli");
        expectedResult.put("type", "GenomeScale");
        expectedResult.put("genome_ref", "1/2/1");

        assertThat(result, is(expectedResult));
    }
/**
     * Testing parsing FBAModel object
     *
     * @throws Exception
     */
Testing parsing FBAModel object
@throws Exception
Testing parsing FBAModel object @throws Exception
@Test
    public void parseObjectsModelTest() throws Exception {
        final String jsonResource = "fbamodel01";
        final String type = "FBAModel";
        final String guid = "WS:1/1/1";
        final Map<GUID, String> guidToJson = parseSubObjects(type, jsonResource, guid);
        assertThat(guidToJson.size(), is(1));
        final String jsonString = guidToJson.values().iterator().next();
        @SuppressWarnings("unchecked")
        HashMap<String, Object> result = new ObjectMapper().readValue(jsonString, HashMap.class);
        HashMap<String, Object> expectedResult = new HashMap<String, Object>();
        expectedResult.put("id", "rast_test");
        expectedResult.put("source", "KBase");
        expectedResult.put("modelcompartments", 2);
        expectedResult.put("modelcompounds", 3);
        expectedResult.put("modelreactions", 3);
        expectedResult.put("name", "E. coli");
        expectedResult.put("type", "GenomeScale");
        expectedResult.put("genome_ref", "1/2/1");
        assertThat(result, is(expectedResult));
    }
@ Test public void parseObjectsModelTest ( ) throws Exception { final String jsonResource = "fbamodel01" ; final String type = "FBAModel" ; final String guid = "WS:1/1/1" ; final Map < GUID , String > guidToJson = parseSubObjects ( type , jsonResource , guid ) ; assertThat ( guidToJson . size ( ) , is ( 1 ) ) ; final String jsonString = guidToJson . values ( ) . iterator ( ) . next ( ) ; @ SuppressWarnings ( "unchecked" ) HashMap < String , Object > result = new ObjectMapper ( ) . readValue ( jsonString , HashMap . class ) ; HashMap < String , Object > expectedResult = new HashMap < String , Object > ( ) ; expectedResult . put ( "id" , "rast_test" ) ; expectedResult . put ( "source" , "KBase" ) ; expectedResult . put ( "modelcompartments" , 2 ) ; expectedResult . put ( "modelcompounds" , 3 ) ; expectedResult . put ( "modelreactions" , 3 ) ; expectedResult . put ( "name" , "E. coli" ) ; expectedResult . put ( "type" , "GenomeScale" ) ; expectedResult . put ( "genome_ref" , "1/2/1" ) ; assertThat ( result , is ( expectedResult ) ) ; }
Testing parsing FBAModel object
 @throws Exception
Testing parsing FBAModel object @throws Exception