FilterBolt extends BaseBasicBolt { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { declarer.declare(new Fields(FIELDS)); } FilterBolt(T toFilter); @Override void execute(Tuple input, BasicOutputCollector collector); @Override void declareOutputFields(OutputFieldsDeclarer declarer); static boolean filter(Tuple input, T toFilter); static final String FIELDS; }
@Test public void shouldDeclareOutputFields() { bolt.declareOutputFields(declarer); verify(declarer, times(1)).declare(any(Fields.class)); }