Code example for EventBus

Methods: register

0
  public void setUp() { 
    updater = createMock(JobUpdateController.class);
 
    service = new JobUpdateEventSubscriber(updater);
 
    eventBus = new EventBus();
    eventBus.register(service);
  } 
 
  @Test
  public void testStateChange() throws Exception {
    updater.instanceChangedState(TASK);
 
    control.replay(); 
 
    eventBus.post(TaskStateChange.initialized(TASK));
  } 
 
  @Test
  public void testDeleted() throws Exception {
Experience pair programming with AI  Get Codota for Java