SetDateBolt extends AbstractProcessingBolt { @Override public void configure(Configuration conf) { dateFormat = conf.getString(DATE_FORMAT); dateFields = new ArrayList<>(); conf.getList(DATE_FIELD).forEach(x -> dateFields.add(x.toString())); _updateIndexField = conf.getBoolean(UPDATE_INDEX_FIELD, false); Validate.notEmpty(dateFields); Validate.notBlank(dateFormat); }  @Override void configure(Configuration conf); static final String DATE_FIELD; static final String DATE_FORMAT; }
@Test public void testConfigure(@Injectable Configuration conf) { new Expectations() {{ conf.getList(SetDateBolt.DATE_FIELD); result = Arrays.asList("field0"); conf.getString(SetDateBolt.DATE_FORMAT); result = "format0"; }}; bolt.configure(conf); assertThat(bolt.dateFields.get(0), is("field0")); assertThat(bolt.dateFormat, is("format0")); }