InterestTermsJSONObjectMapper { public Topic map(String json) throws IOException { return AsahFaroBackendJSONObjectMapper.map(json, Topic.class); }  Topic map(String json); Results<Topic> mapToResults(String json);  }
@Test public void testMap() throws Exception { Topic topic = _interestTermsJSONObjectMapper.map( _read("get-interests-term.json")); Assert.assertNotNull(topic); Assert.assertEquals(7, topic.getId()); Assert.assertEquals(0.08653350323695352, topic.getId(), _DELTA); List<Topic.TopicTerm> topicTerms = topic.getTerms(); Assert.assertEquals(topicTerms.toString(), 3, topicTerms.size()); Topic.TopicTerm topicTerm = topicTerms.get(0); Assert.assertEquals("javascript", topicTerm.getKeyword()); Assert.assertEquals(0.0945945945945946, topicTerm.getWeight(), _DELTA); }
@Test(expected = IOException.class) public void testMapThrowsIOException() throws Exception { _interestTermsJSONObjectMapper.map("invalid json"); }