EventToLMMSerializerBolt extends BaseRichBolt { @SuppressWarnings("rawtypes") @Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.collector = collector; this.gson = new Gson(); this.formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); this.formatter.setTimeZone(TimeZone.getTimeZone("UTC")); this.calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); }  @SuppressWarnings("rawtypes") @Override void prepare(Map stormConf, TopologyContext context, OutputCollector collector); @Override void execute(Tuple tuple); @Override void declareOutputFields(OutputFieldsDeclarer declarer); static final String TIMESTAMP; static final String TENANT_ID; }
@Test public void testPrepare() { EventToLMMSerializerBolt bolt = new EventToLMMSerializerBolt(); Map<String, String> conf = new HashMap<>(); bolt.prepare(conf, null, collector); assertNotNull(bolt.getGson()); assertNotNull(bolt.getCollector()); }