use of org.eol.globi.tool.NullImportLogger in project eol-globi-data by jhpoelen.
the class TaxonNameEnricherTest method detectHigherOrderTaxa.
@Test
public void detectHigherOrderTaxa() throws StudyImporterException {
List<String> msgs = new ArrayList<>();
List<Map<String, String>> received = new ArrayList<>();
final InteractionListener listener = new TaxonNameEnricher(interaction -> received.add(interaction), new NullImportLogger() {
@Override
public void info(LogContext ctx, String message) {
msgs.add(message);
}
@Override
public void warn(LogContext ctx, String message) {
msgs.add(message);
}
@Override
public void severe(LogContext ctx, String message) {
msgs.add(message);
}
});
final TreeMap<String, String> link = new TreeMap<>();
link.put(SOURCE_TAXON_SPECIES, "Donald duck");
link.put(DatasetImporterForTSV.INTERACTION_TYPE_ID, InteractType.ATE.getIRI());
link.put(DATASET_CITATION, "some source ref");
link.put(REFERENCE_ID, "123");
link.put(REFERENCE_CITATION, "");
listener.on(link);
assertThat(received.size(), is(1));
Map<String, String> receivedInteraction = received.get(0);
assertThat(receivedInteraction.get(SOURCE_TAXON_NAME), is("Donald duck"));
}
Aggregations