ConfigurableIngestTopology { void configureTickFrequency(Configuration boltConf, BoltDeclarer boltDeclarer) { String tickFrequency = boltConf.getString(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS.replaceAll("\\.", "..")); if (StringUtils.isNotBlank(tickFrequency)) { boltDeclarer.addConfiguration(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, tickFrequency); } }  static void main(String[] args);  }
@Test public void testConfigureTickFrequency( @Injectable BoltDeclarer boltDeclarer) throws Exception { URL resource = TestResourceUtils.getResource(this.getClass(), "tick-frequency-config.xml"); XMLConfiguration conf = new XMLConfiguration(resource); new Expectations() {{ boltDeclarer.addConfiguration(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, "30"); }}; topology.configureTickFrequency(conf, boltDeclarer); }
@Test public void testConfigureTickFrequencyEmpty( @Injectable Configuration conf, @Injectable BoltDeclarer boltDeclarer) throws Exception { new Expectations() {{ conf.getString(anyString); result = ""; boltDeclarer.addConfiguration(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, any); times = 0; }}; topology.configureTickFrequency(conf, boltDeclarer); }