@Test public void testCreateTaxonLookupTableForMultiMedia() { ScientificName scientificName = new ScientificName(); scientificName.setFullScientificName("Bombus affinis Cresson, 1863"); scientificName.setScientificNameGroup("bombus affinis"); MultiMediaContentIdentification mmci = new MultiMediaContentIdentification(); mmci.setScientificName(scientificName); List<MultiMediaContentIdentification> list = new ArrayList<>(); list.add(mmci); MultiMediaObject mmo = new MultiMediaObject(); mmo.setIdentifications(list); List<MultiMediaObject> mmoList = new ArrayList<>(); mmoList.add(mmo); Map<String, List<Taxon>> actual = EnrichmentUtil.createTaxonLookupTableForMultiMedia(mmoList); String actualKeyValue = actual.entrySet().stream().map(i -> i.getKey()).findFirst().get(); List<Taxon> taxonList = actual.get(actualKeyValue); String expectedKeyValue = "bombus affinis"; String expectedId = "6931870@COL"; String expectedScientificNameGroup = "bombus affinis"; String expectedAuthorshipVerbatim = "Cresson, 1863"; String expectedFullScientificName = "Bombus affinis Cresson, 1863"; assertEquals("01", expectedKeyValue, actualKeyValue); assertEquals("02", expectedId, taxonList.get(0).getId()); assertEquals("03", expectedScientificNameGroup, taxonList.get(0).getAcceptedName().getScientificNameGroup()); assertEquals("04", expectedFullScientificName, taxonList.get(0).getAcceptedName().getFullScientificName()); assertEquals("05", expectedAuthorshipVerbatim, taxonList.get(0).getAcceptedName().getAuthorshipVerbatim()); }
static Map<String, List<Taxon>> createTaxonLookupTableForMultiMedia( List<MultiMediaObject> multimedia) { String[] names = extractNamesFromMultiMedia(multimedia); if (logger.isDebugEnabled()) { String fmt = "{} unique scientific names extracted from {} multimedia"; logger.debug(fmt, names.length, multimedia.size()); } return createTaxonLookupTable(names); }
EnrichmentUtil { static Map<String, List<Taxon>> createTaxonLookupTableForMultiMedia( List<MultiMediaObject> multimedia) { String[] names = extractNamesFromMultiMedia(multimedia); if (logger.isDebugEnabled()) { String fmt = "{} unique scientific names extracted from {} multimedia"; logger.debug(fmt, names.length, multimedia.size()); } return createTaxonLookupTable(names); } }
EnrichmentUtil { static Map<String, List<Taxon>> createTaxonLookupTableForMultiMedia( List<MultiMediaObject> multimedia) { String[] names = extractNamesFromMultiMedia(multimedia); if (logger.isDebugEnabled()) { String fmt = "{} unique scientific names extracted from {} multimedia"; logger.debug(fmt, names.length, multimedia.size()); } return createTaxonLookupTable(names); }  }
EnrichmentUtil { static Map<String, List<Taxon>> createTaxonLookupTableForMultiMedia( List<MultiMediaObject> multimedia) { String[] names = extractNamesFromMultiMedia(multimedia); if (logger.isDebugEnabled()) { String fmt = "{} unique scientific names extracted from {} multimedia"; logger.debug(fmt, names.length, multimedia.size()); } return createTaxonLookupTable(names); }  static List<TaxonomicEnrichment> createEnrichments(List<Taxon> taxa); }
EnrichmentUtil { static Map<String, List<Taxon>> createTaxonLookupTableForMultiMedia( List<MultiMediaObject> multimedia) { String[] names = extractNamesFromMultiMedia(multimedia); if (logger.isDebugEnabled()) { String fmt = "{} unique scientific names extracted from {} multimedia"; logger.debug(fmt, names.length, multimedia.size()); } return createTaxonLookupTable(names); }  static List<TaxonomicEnrichment> createEnrichments(List<Taxon> taxa);  }