Use singleton EventBus in README and unit test

This commit is contained in:
2020-09-08 09:38:46 +02:00
parent f407021cea
commit bdf7dcfeda
2 changed files with 7 additions and 7 deletions

View File

@ -12,17 +12,16 @@ import org.junit.jupiter.api.*;
*/
class EventBusTest implements EventListener {
public EventBus eventBus = new EventBus();
int hits;
@BeforeEach
public void registerListener() {
eventBus.registerListener(this);
EventBus.getInstance().registerListener(this);
}
@Test
void testDispatch() {
eventBus.dispatch(new SimpleEvent());
EventBus.getInstance().dispatch(new SimpleEvent());
}
@Event(priority = 50)