LogRecordDateBolt extends AbstractLoggingBolt { @Override public void configure(Configuration conf) throws ConfigurationException { super.configure(conf); dateFormat = conf.getString(DATE_FORMAT, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); sample = conf.getDouble(SAMPLE, 0.01); Validate.notBlank(dateFormat); validateDateFormat(); }  @Override void configure(Configuration conf); static final String DATE_FORMAT; static final String SAMPLE; }
@Test public void testConfigure(@Injectable Configuration conf) throws ConfigurationException { new Expectations(bolt) {{ conf.getString(LogRecordDateBolt.LEVEL); result = "info"; conf.getString(LogRecordDateBolt.DATE_FORMAT, anyString); result = "format0"; bolt.validateDateFormat(); }}; bolt.configure(conf); assertThat(bolt.dateFormat, is("format0")); assertThat(bolt.level, is(Level.INFO)); }