bridge.pause();
eventBus.publish(new String("Foo"));
Assert.assertFalse(waitForConsumeCount(bridge, 2, 1, TimeUnit.SECONDS));
bridge.resume();
eventBus.publish(new String("Foo"));
Assert.assertTrue(waitForConsumeCount(bridge, 2, 1, TimeUnit.SECONDS));
}
public boolean waitForConsumeCount(DummyEventBusBridge bridge, long expected, long delay, TimeUnit units) throws Exception {
long intervals = TimeUnit.MILLISECONDS.convert(delay, units)/100;