GeoJsonPointReverseArrayBolt extends AbstractProcessingBolt { @Override protected void process(LogRecord record) { for (Map.Entry<String, String> entry : srcDestFieldMapping.entrySet()) { final String src = record.getValue(entry.getKey()); String reversedArrayJson = reverseJsonArray(src); record.setValue(entry.getValue(), reversedArrayJson); } }  @Override void configure(Configuration conf); static final String SRC_FIELD; static final String DEST_FIELD; }
@Test public void testProcess(@Injectable LogRecord record) throws Exception { Map<String, String> map = new HashMap<>(); map.put("src", "dest"); bolt.srcDestFieldMapping = map; new Expectations(bolt) {{ record.getValue("src"); result = "srcString"; bolt.reverseJsonArray("srcString"); result = "destString"; record.setValue("dest", "destString"); }}; bolt.process(record); }