SuppressionBolt extends BaseRichBolt { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public final void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.collector = collector; this.templateMap = new HashMap<>(); this.counter = new HashMap<>(); this.stateMap = new HashMap<>(); this.storeFactory = new UnifiedFactory(); try { initTemplates(stormConf); } catch (Exception e) { throw new RuntimeException(e); } logger.info("Suppression bolt initialized"); }  @SuppressWarnings({ "rawtypes", "unchecked" }) @Override final void prepare(Map stormConf, TopologyContext context, OutputCollector collector); void initTemplates(Map<String, String> conf); @Override final void execute(Tuple tuple); void updateTemplate(String ruleGroup, String templateJson, boolean delete); @Override void declareOutputFields(OutputFieldsDeclarer declarer); @Override Map<String, Object> getComponentConfiguration();  }
@Test public void testPrepare() { SuppressionBolt bolt = new SuppressionBolt(); bolt.prepare(conf, null, mockCollector); assertEquals(mockCollector, bolt.getCollector()); assertEquals(2, bolt.getTemplateMap().size()); }