BAEL-639: Guide to Guava's EventBus Tests - adding sleep

This commit is contained in:
slavisa-baeldung 2017-02-15 09:58:37 +01:00
parent 9135c6073e
commit f7ef3766cb
1 changed files with 3 additions and 1 deletions

View File

@ -44,10 +44,12 @@ public class GuavaEventBusTest {
} }
@Test @Test
public void givenUnSubscribedEvent_whenEventHandledByDeadEvent_thenSuccess() { public void givenUnSubscribedEvent_whenEventHandledByDeadEvent_thenSuccess() throws InterruptedException {
listener.resetEventsHandled(); listener.resetEventsHandled();
eventBus.post(12345); eventBus.post(12345);
Thread.sleep(1000);
assertEquals(1, listener.getEventsHandled()); assertEquals(1, listener.getEventsHandled());
} }