ParserBolt extends ConfiguredParserBolt implements Serializable { public ParserBolt withBatchTimeoutDivisor(int batchTimeoutDivisor) { if (batchTimeoutDivisor <= 0) { throw new IllegalArgumentException(String.format("batchTimeoutDivisor must be positive. Value provided was %s", batchTimeoutDivisor)); } this.batchTimeoutDivisor = batchTimeoutDivisor; return this; } ParserBolt( String zookeeperUrl
                   , ParserRunner parserRunner
                     , Map<String, WriterHandler> sensorToWriterMap
  ); ParserBolt withBatchTimeoutDivisor(int batchTimeoutDivisor); int getBatchTimeoutDivisor(); void setMessageGetStrategy(MessageGetStrategy messageGetStrategy); void setOutputCollector(OutputCollector collector); void setAckTuplesPolicy(AckTuplesPolicy ackTuplesPolicy); @Override Map<String, Object> getComponentConfiguration(); @SuppressWarnings("unchecked") @Override void prepare(Map stormConf, TopologyContext context, OutputCollector collector); @SuppressWarnings("unchecked") @Override void execute(Tuple tuple); @Override void declareOutputFields(OutputFieldsDeclarer declarer);  }
@Test public void shouldThrowExceptionOnInvalidBatchTimeoutDivisor() { IllegalArgumentException e = assertThrows( IllegalArgumentException.class, () -> new ParserBolt( "zookeeperUrl", parserRunner, new HashMap<String, WriterHandler>() {{ put("yaf", writerHandler); }}) .withBatchTimeoutDivisor(-1)); assertEquals("batchTimeoutDivisor must be positive. Value provided was -1", e.getMessage()); }