ConceptpowerConnector implements IConceptpowerConnector { @Override @Cacheable(value = "concepts") public ConceptpowerReply search(String item, String pos) { Map<String, String> vars = new HashMap<String, String>(); vars.put("name", item); vars.put("pos", pos); return restTemplate.getForObject(conceptURL + searchURL + "{name}/{pos}", ConceptpowerReply.class, vars); }  @Override @Cacheable(value = "concepts") ConceptpowerReply search(String item, String pos); @Override @Cacheable(value = "concepts") ConceptpowerReply search(String searchTerm); @Override @Cacheable(value = "concepts", key = "#id") ConceptpowerReply getById(String id);  }
@Test public void testSearch() { ConceptpowerReply reply = connectorUnderTest.search("dog", "noun"); assertNotNull(reply); assertEquals(1, reply.getConceptEntry().size()); assertEquals("dog", reply.getConceptEntry().get(0).getLemma()); assertEquals("noun", reply.getConceptEntry().get(0).getPos()); }
@Test public void testSearchNoResults() { ConceptpowerReply reply = connectorUnderTest.search("cat", "noun"); assertNotNull(reply); assertEquals(0, reply.getConceptEntry().size()); }