use of org.eol.globi.domain.TaxonImage in project eol-globi-data by jhpoelen.
the class ImageServiceTest method taxonFoundButNoImage.
@Test
public void taxonFoundButNoImage() throws IOException {
imageService.setTaxonSearch(new TaxonSearch() {
@Override
public Map<String, String> findTaxon(String scientificName, HttpServletRequest request) throws IOException {
return new HashMap<String, String>() {
{
put(PropertyAndValueDictionary.EXTERNAL_ID, "EOL:123456");
put(PropertyAndValueDictionary.NAME, "some latin name");
put(PropertyAndValueDictionary.PATH, "path1 | path2");
put(PropertyAndValueDictionary.COMMON_NAMES, "one @en | zwei @de");
}
};
}
@Override
public Map<String, String> findTaxonWithImage(String scientificName) throws IOException {
return null;
}
});
imageService.setImageSearch(new ImageSearch() {
@Override
public TaxonImage lookupImageForExternalId(String externalId) {
TaxonImage taxonImage = new TaxonImage();
taxonImage.setInfoURL("some info url");
return taxonImage;
}
});
TaxonImage image = imageService.findTaxonImagesForTaxonWithName("some name");
assertThat(image.getInfoURL(), is("some info url"));
assertThat(image.getScientificName(), is("some latin name"));
assertThat(image.getCommonName(), is("one"));
assertThat(image.getTaxonPath(), is("path1 | path2"));
}
use of org.eol.globi.domain.TaxonImage in project eol-globi-data by jhpoelen.
the class ImageServiceTest method findImagesForExternalId.
@Test
public void findImagesForExternalId() throws IOException {
TaxonImage image = imageService.findTaxonImagesForExternalId("EOL:1234");
assertThat(image.getCommonName(), is("some common name for EOL:1234"));
}
Aggregations