Search in sources :

Example 21 with GlobalNamesService

use of org.eol.globi.taxon.GlobalNamesService in project eol-globi-data by jhpoelen.

the class GlobalNamesServiceTest method lookupWoRMSCod.

@Test
public void lookupWoRMSCod() throws PropertyEnricherException {
    GlobalNamesService service = new GlobalNamesService(GlobalNamesSources.WORMS);
    HashMap<String, String> props1 = new HashMap<String, String>();
    props1.put(PropertyAndValueDictionary.NAME, "Gadus morhua");
    Map<String, String> enrich = service.enrich(props1);
    assertThat(enrich.get(PropertyAndValueDictionary.PATH), containsString("Gadiformes | Gadidae | Gadus | Gadus morhua"));
    assertThat(enrich.get(PropertyAndValueDictionary.COMMON_NAMES), is(nullValue()));
}
Also used : HashMap(java.util.HashMap) Matchers.containsString(org.hamcrest.Matchers.containsString) GlobalNamesService(org.eol.globi.taxon.GlobalNamesService) Test(org.junit.Test)

Aggregations

GlobalNamesService (org.eol.globi.taxon.GlobalNamesService)21 Matchers.containsString (org.hamcrest.Matchers.containsString)21 Test (org.junit.Test)20 HashMap (java.util.HashMap)11 ArrayList (java.util.ArrayList)9 NameType (org.eol.globi.domain.NameType)9 Taxon (org.eol.globi.domain.Taxon)9 TermMatchListener (org.eol.globi.taxon.TermMatchListener)9