@Test public void testCreateMultiMediaLookupTableForSpecimens() { ScientificName scientificName = new ScientificName(); scientificName.setFullScientificName("Bombus affinis Cresson, 1863"); scientificName.setScientificNameGroup("bombus affinis"); SpecimenIdentification identification = new SpecimenIdentification(); identification.setScientificName(scientificName); Specimen specimen = new Specimen(); specimen.addIndentification(identification); specimen.setId("L.1911711@BRAHMS"); List<Specimen> specimens = new ArrayList<>(); specimens.add(specimen); Map<String, List<ServiceAccessPoint>> actual = EnrichmentUtil.createMultiMediaLookupTableForSpecimens(specimens); String expectedKey = "L.1911711@BRAHMS"; String actualKey = actual.entrySet().stream().map(i -> i.getKey()).findFirst().get(); String expectedUri = "http: String expectedFormat = "image/jpeg"; List<ServiceAccessPoint> list = actual.get(actualKey); assertNotNull("01", list); assertEquals("02", expectedKey, actualKey); assertEquals("03", expectedUri, list.get(0).getAccessUri().toString()); assertEquals("04", expectedFormat, list.get(0).getFormat()); }
static Map<String, List<ServiceAccessPoint>> createMultiMediaLookupTableForSpecimens( List<Specimen> specimens) { String[] specimenIds = extractIdsFromSpecimens(specimens); if (logger.isDebugEnabled()) { String fmt = "{} unique IDs extracted from {} specimens"; logger.debug(fmt, specimenIds.length, specimens.size()); } return createMultiMediaLookupTable(specimenIds); }
EnrichmentUtil { static Map<String, List<ServiceAccessPoint>> createMultiMediaLookupTableForSpecimens( List<Specimen> specimens) { String[] specimenIds = extractIdsFromSpecimens(specimens); if (logger.isDebugEnabled()) { String fmt = "{} unique IDs extracted from {} specimens"; logger.debug(fmt, specimenIds.length, specimens.size()); } return createMultiMediaLookupTable(specimenIds); } }
EnrichmentUtil { static Map<String, List<ServiceAccessPoint>> createMultiMediaLookupTableForSpecimens( List<Specimen> specimens) { String[] specimenIds = extractIdsFromSpecimens(specimens); if (logger.isDebugEnabled()) { String fmt = "{} unique IDs extracted from {} specimens"; logger.debug(fmt, specimenIds.length, specimens.size()); } return createMultiMediaLookupTable(specimenIds); }  }
EnrichmentUtil { static Map<String, List<ServiceAccessPoint>> createMultiMediaLookupTableForSpecimens( List<Specimen> specimens) { String[] specimenIds = extractIdsFromSpecimens(specimens); if (logger.isDebugEnabled()) { String fmt = "{} unique IDs extracted from {} specimens"; logger.debug(fmt, specimenIds.length, specimens.size()); } return createMultiMediaLookupTable(specimenIds); }  static List<TaxonomicEnrichment> createEnrichments(List<Taxon> taxa); }
EnrichmentUtil { static Map<String, List<ServiceAccessPoint>> createMultiMediaLookupTableForSpecimens( List<Specimen> specimens) { String[] specimenIds = extractIdsFromSpecimens(specimens); if (logger.isDebugEnabled()) { String fmt = "{} unique IDs extracted from {} specimens"; logger.debug(fmt, specimenIds.length, specimens.size()); } return createMultiMediaLookupTable(specimenIds); }  static List<TaxonomicEnrichment> createEnrichments(List<Taxon> taxa);  }