@Test public void occurrenceExtensionIsEmptyTest() { String id = "1"; String somethingCore = "somethingCore"; Map<String, String> ext = new HashMap<>(2); ext.put(DwcTerm.occurrenceID.qualifiedName(), id); ext.put(somethingCore, somethingCore); ExtendedRecord er = ExtendedRecord.newBuilder() .setId(id) .setCoreTerms(ext) .setExtensions( Collections.singletonMap(Occurrence.qualifiedName(), Collections.emptyList())) .build(); final List<ExtendedRecord> expected = createCollection(true, false, id + "_" + somethingCore); PCollection<ExtendedRecord> result = p.apply(Create.of(er)).apply(OccurrenceExtensionTransform.create()); PAssert.that(result).containsInAnyOrder(expected); p.run(); }
public static SingleOutput<ExtendedRecord, ExtendedRecord> create() { return ParDo.of(new OccurrenceExtensionTransform()); }
OccurrenceExtensionTransform extends DoFn<ExtendedRecord, ExtendedRecord> { public static SingleOutput<ExtendedRecord, ExtendedRecord> create() { return ParDo.of(new OccurrenceExtensionTransform()); } }
OccurrenceExtensionTransform extends DoFn<ExtendedRecord, ExtendedRecord> { public static SingleOutput<ExtendedRecord, ExtendedRecord> create() { return ParDo.of(new OccurrenceExtensionTransform()); }  }
OccurrenceExtensionTransform extends DoFn<ExtendedRecord, ExtendedRecord> { public static SingleOutput<ExtendedRecord, ExtendedRecord> create() { return ParDo.of(new OccurrenceExtensionTransform()); }  static SingleOutput<ExtendedRecord, ExtendedRecord> create(); void setCounterFn(SerializableConsumer<String> counterFn); @ProcessElement void processElement(@Element ExtendedRecord er, OutputReceiver<ExtendedRecord> out); void convert(ExtendedRecord er, Consumer<ExtendedRecord> resultConsumer); }
OccurrenceExtensionTransform extends DoFn<ExtendedRecord, ExtendedRecord> { public static SingleOutput<ExtendedRecord, ExtendedRecord> create() { return ParDo.of(new OccurrenceExtensionTransform()); }  static SingleOutput<ExtendedRecord, ExtendedRecord> create(); void setCounterFn(SerializableConsumer<String> counterFn); @ProcessElement void processElement(@Element ExtendedRecord er, OutputReceiver<ExtendedRecord> out); void convert(ExtendedRecord er, Consumer<ExtendedRecord> resultConsumer);  }