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

        final String jsonResource = "assembly01";
        final String type = "Assembly";
        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("dna_size", 4706287);
        expectedResult.put("external_source_id", "NC_008321.fna");
        expectedResult.put("contigs", 1);
        expectedResult.put("name", "test_asmb.1");
        expectedResult.put("gc_content", 0.478944654246543);

        assertThat(expectedResult, is(result));
    }
/**
     * Testing parsing Assembly object
     * 
     * @throws Exception
     */
Testing parsing Assembly object

@throws Exception
Testing parsing Assembly object @throws Exception
@Test
    public void parseSubObjectsGenomeTest() throws Exception {
        final String jsonResource = "assembly01";
        final String type = "Assembly";
        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("dna_size", 4706287);
        expectedResult.put("external_source_id", "NC_008321.fna");
        expectedResult.put("contigs", 1);
        expectedResult.put("name", "test_asmb.1");
        expectedResult.put("gc_content", 0.478944654246543);
        assertThat(expectedResult, is(result));
    }
@ Test public void parseSubObjectsGenomeTest ( ) throws Exception { final String jsonResource = "assembly01" ; final String type = "Assembly" ; 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 ( "dna_size" , 4706287 ) ; expectedResult . put ( "external_source_id" , "NC_008321.fna" ) ; expectedResult . put ( "contigs" , 1 ) ; expectedResult . put ( "name" , "test_asmb.1" ) ; expectedResult . put ( "gc_content" , 0.478944654246543 ) ; assertThat ( expectedResult , is ( result ) ) ; }
Testing parsing Assembly object
Testing parsing Assembly object