IndividualSegmentJSONObjectMapper { public IndividualSegment map(String json) throws IOException { return AsahFaroBackendJSONObjectMapper.map( json, IndividualSegment.class); }  IndividualSegment map(String json); Results<IndividualSegment> mapToResults(String json);  }
@Test public void testMap() throws Exception { IndividualSegment individualSegment = _individualSegmentJSONObjectMapper.map( _read("get-individual-segment.json")); Assert.assertNotNull(individualSegment); Assert.assertEquals("324849894334623092", individualSegment.getId()); Assert.assertEquals("British Developers", individualSegment.getName()); Assert.assertEquals(8L, individualSegment.getIndividualCount()); Author author = individualSegment.getAuthor(); Assert.assertEquals("132184", author.getId()); }
@Test(expected = IOException.class) public void testMapThrowsIOException() throws Exception { _individualSegmentJSONObjectMapper.map("invalid json"); }