### Question:
SlackMessageSpout extends BaseRichSpout { @Override public void declareOutputFields(OutputFieldsDeclarer fields) { fields.declare(new Fields(SLACK_MESSAGE_FIELD_STR)); } SlackMessageSpout(); @Override void open(@SuppressWarnings("rawtypes") Map conf, TopologyContext context,
                     SpoutOutputCollector collector); @OnMessage void onMessageEvent(Message message, Session session); @OnError void onError(Throwable t); @Override void nextTuple(); @Override void declareOutputFields(OutputFieldsDeclarer fields); @Override void close(); static final String SPOUT_ID; static final String SLACK_MESSAGE_FIELD_STR; }### Answer:
@Test public void testDeclareOutputFields() { OutputFieldsDeclarer mockFields = mock(OutputFieldsDeclarer.class); underTest.declareOutputFields(mockFields); verify(mockFields).declare(any(Fields.class)); }