DecomposeObjectArrayBolt extends AbstractProcessingBolt { @Override public void configure(Configuration conf) { arrayField = conf.getString(ARRAY_FIELD); objectField = conf.getString(OBJECT_FIELD); destField = conf.getString(DEST_FIELD); Validate.notBlank(arrayField); Validate.notBlank(objectField); Validate.notBlank(destField); }  @Override void configure(Configuration conf); static final String ARRAY_FIELD; static final String OBJECT_FIELD; static final String DEST_FIELD; }
@Test public void testConfigure(@Injectable Configuration conf) { new Expectations() {{ conf.getString(DecomposeObjectArrayBolt.ARRAY_FIELD); result = "field0"; conf.getString(DecomposeObjectArrayBolt.OBJECT_FIELD); result = "field1"; conf.getString(DecomposeObjectArrayBolt.DEST_FIELD); result = "field2"; }}; bolt.configure(conf); assertThat(bolt.arrayField, is("field0")); assertThat(bolt.objectField, is("field1")); assertThat(bolt.destField, is("field2")); }