RollingCountBolt extends BaseRichBolt { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { declarer.declare(new Fields("obj", "count", "actualWindowLengthInSeconds")); } RollingCountBolt();  RollingCountBolt(int windowLengthInSeconds, int emitFrequencyInSeconds); @SuppressWarnings("rawtypes") @Override void prepare(Map stormConf, TopologyContext context, OutputCollector collector); @Override void execute(Tuple tuple); @Override void declareOutputFields(OutputFieldsDeclarer declarer); @Override Map<String, Object> getComponentConfiguration();  }
@Test public void shouldDeclareOutputFields() { OutputFieldsDeclarer declarer = mock(OutputFieldsDeclarer.class); RollingCountBolt bolt = new RollingCountBolt(); bolt.declareOutputFields(declarer); verify(declarer, times(1)).declare(any(Fields.class)); }