ConstBolt extends BaseBasicBolt { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { declarer.declare(new Fields(FIELDS)); } ConstBolt(); @Override void prepare(Map conf, TopologyContext context); @Override void execute(Tuple tuple, BasicOutputCollector collector); @Override void declareOutputFields(OutputFieldsDeclarer declarer); static final String FIELDS; }
@Test public void shouldDeclareOutputFields() { bolt.declareOutputFields(declarer); verify(declarer, times(1)).declare(any(Fields.class)); }