MapEnricher extends AbstractEnricher<Map<String, Object>, Map<String, Object>> { @Override public void setLookupFields(List<String> lookupFields) { super.setLookupFields(lookupFields); }  @Override void setLookupFields(List<String> lookupFields); @Override void setIncludeFields(List<String> includeFields); final transient DefaultInputPort<Map<String, Object>> input; final transient DefaultOutputPort<Map<String, Object>> output; }
@Test public void includeAllKeys() { MapEnricher oper = new MapEnricher(); oper.setStore(new MemoryStore()); oper.setLookupFields(Arrays.asList("In1")); oper.setup(null); CollectorTestSink sink = new CollectorTestSink(); TestUtils.setSink(oper.output, sink); Map<String, Object> inMap = Maps.newHashMap(); inMap.put("In1", "Value1"); inMap.put("In2", "Value2"); oper.activate(null); oper.beginWindow(1); oper.input.process(inMap); oper.endWindow(); oper.deactivate(); Assert.assertEquals("includeSelectedKeys: Number of tuples emitted: ", 1, sink.collectedTuples.size()); Assert.assertEquals("Enrich Tuple: ", "{A=Val_A, B=Val_B, C=Val_C, In2=Value2, In1=Value3}", sink.collectedTuples.get(0).toString()); }