RandomMessageSpout extends BaseRichSpout { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { declarer.declare(new Fields(FIELDS)); } RandomMessageSpout(boolean ackEnabled);  RandomMessageSpout(int sizeInBytes, boolean ackEnabled); void open(Map conf, TopologyContext context, SpoutOutputCollector collector); @Override void nextTuple(); @Override void declareOutputFields(OutputFieldsDeclarer declarer); static final String FIELDS; static final String MESSAGE_SIZE; static final int DEFAULT_MESSAGE_SIZE; }
@Test public void shouldDeclareOutputFields() { RandomMessageSpout spout = new RandomMessageSpout(messageSize, false); spout.declareOutputFields(declarer); verify(declarer, times(1)).declare(any(Fields.class)); }