ProcessInstanceLogPresenter extends AbstractMultiGridPresenter<ProcessInstanceLogSummary, ProcessInstanceLogPresenter.ProcessInstanceLogView> implements ProcessInstanceSummaryAware { @Override public void setProcessInstance(ProcessInstanceSummary processInstance) { this.processInstance = processInstance; if (logsDataSetQueryHelper.getCurrentTableSettings() == null) { logsDataSetQueryHelper.setCurrentTableSettings( filterSettingsManager.createDefaultFilterSettingsPrototype(processInstance.getProcessInstanceId())); setupActiveSearchFilters(); } else { refreshGrid(); } }  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 dataSetLookupNotFoundTest() { doAnswer((InvocationOnMock invocation) -> { ((DataSetReadyCallback) invocation.getArguments()[1]).notFound(); return null; }).when(logsDataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); presenter.setProcessInstance(new ProcessInstanceSummary()); verify(errorHandler).notFound(); }
@Test public void dataSetLookupErrorTest() { final ClientRuntimeError error = new ClientRuntimeError("error message"); doAnswer((InvocationOnMock invocation) -> { ((DataSetReadyCallback) invocation.getArguments()[1]).onError(error); return null; }).when(logsDataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); presenter.setProcessInstance(new ProcessInstanceSummary()); verify(errorHandler).onError(error); verify(errorCallback).error(error.getThrowable()); }