TaskLogsPresenter extends AbstractTaskPresenter { public void onTaskSelectionEvent(@Observes final TaskSelectionEvent event) { setSelectedTask(event); refreshLogs(); } @Inject  TaskLogsPresenter(final TaskLogsView view,
                             final Caller<TaskService> taskService); @PostConstruct void init(); int getPageSize(); void setCurrentPage(int i); IsWidget getView(); void refreshLogs(); void loadTaskLogs(); void loadMoreProcessInstanceLogs(); void onTaskSelectionEvent(@Observes final TaskSelectionEvent event); void onTaskRefreshedEvent(@Observes final TaskRefreshedEvent event); static final int PAGE_SIZE; }
@Test public void logsUpdatedWhenTaskSelected() { presenter.onTaskSelectionEvent(new TaskSelectionEvent(serverTemplateId, containerId, TASK_ID)); verify(taskService).getTaskEvents(serverTemplateId, containerId, TASK_ID, 0, 10); ArgumentCaptor<List> argumentDESC = ArgumentCaptor.forClass(List.class); verify(taskLogsView).setLogs(argumentDESC.capture()); assertEquals(3, argumentDESC.getValue().size()); }