TaskSelectedHandler handler = EasyMock.createMock(TaskSelectedHandler.class);
handler.onSelectedTask(EasyMock.anyObject(TaskSelectedEvent.class));
EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
public Object answer() throws Throwable {
Object[] params = EasyMock.getCurrentArguments();
TaskSelectedEvent event = (TaskSelectedEvent) params[0];
assertNotNull("event.selectedTask shouldn't be null", event.getSelectedTask());
assertEquals("ioRef and event.selectedTask should be the same", ioRef, event.getSelectedTask());
return null;
}
}).once();
bus.addHandler(TaskSelectedEvent.TYPE, handler);
EasyMock.replay(view, service, i18n, filterView, advancedView, handler);