SlackMessageSpout extends BaseRichSpout { @OnError public void onError(Throwable t) { LOG.error(Throwables.getStackTraceAsString(t)); } 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; }
@Test public void testOnError() { underTest.onError(new RuntimeException("test")); }