ProcessInstanceLogPresenter extends AbstractMultiGridPresenter<ProcessInstanceLogSummary, ProcessInstanceLogPresenter.ProcessInstanceLogView> implements ProcessInstanceSummaryAware { public void loadMoreProcessInstanceLogs() { setCurrentPage(currentPage + 1); loadProcessInstanceLogs(); }  int getPageSize(); void setCurrentPage(int i); int getCurrentPage(); @Inject void setDataSetQueryHelper(final DataSetQueryHelper dataSetQueryHelper); @Inject void setProcessInstanceLogBasicFiltersPresenter(final ProcessInstanceLogBasicFiltersPresenter pILBasicFiltersPresenter); @Inject void setFilterSettingsManager(final ProcessInstanceLogFilterSettingsManager filterSettingsManager); @PostConstruct void init(); IsWidget getWidget(); HTMLElement getBasicFiltersView(); DataSetQueryHelper getDataSetQueryHelper(); void loadProcessInstanceLogs(); void loadMoreProcessInstanceLogs(); void loadTaskDetails(Long workItemId,
                                final Date logDate,
                                ProcessInstanceLogItemDetailsView workItemView); void loadWorkItemDetails(Long workItemId,
                                    ProcessInstanceLogItemDetailsView workItemView); @Override void setProcessInstance(ProcessInstanceSummary processInstance); void refreshGrid(); @Override boolean existActiveSearchFilters(); void setupActiveSearchFilters(); @Override void createListBreadcrumb(); @Inject void setTaskService(Caller<TaskService> taskService); @Inject void setProcessRuntimeDataService(Caller<ProcessRuntimeDataService> processRuntimeDataService); static final int PAGE_SIZE; }
@Test public void testLoadMoreProcessInstanceLogs() { presenter.setCurrentPage(0); presenter.setProcessInstance(new ProcessInstanceSummary()); assertEquals(0, presenter.getCurrentPage()); verify(logsDataSetQueryHelper).lookupDataSet(eq(presenter.getPageSize() * presenter.getCurrentPage()), any()); ArgumentCaptor<List> argumentDESC = ArgumentCaptor.forClass(List.class); verify(view).setLogsList(argumentDESC.capture()); assertEquals(4, argumentDESC.getValue().size()); verify(view).hideLoadButton(true); presenter.loadMoreProcessInstanceLogs(); assertEquals(1, presenter.getCurrentPage()); verify(logsDataSetQueryHelper).lookupDataSet(eq(presenter.getPageSize() * presenter.getCurrentPage()), any()); verify(view, times(2)).setLogsList(argumentDESC.capture()); assertEquals(8, argumentDESC.getValue().size()); verify(view, times(2)).setLogsList(anyList()); }