ProcessInstanceLogPresenter extends AbstractMultiGridPresenter<ProcessInstanceLogSummary, ProcessInstanceLogPresenter.ProcessInstanceLogView> implements ProcessInstanceSummaryAware { public void loadWorkItemDetails(Long workItemId, ProcessInstanceLogItemDetailsView workItemView) { processRuntimeDataService.call( (WorkItemSummary workItemSummary) -> { workItemView.setDetailsData(workItemSummary); }).getWorkItemByProcessInstanceId(processInstance.getServerTemplateId(), processInstance.getDeploymentId(), processInstance.getProcessInstanceId(), workItemId); }  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 testLoadWorkItemDetails() { Long workItemId = 1L; Long processInstanceId = 2L; String containerId = "deploymentId"; String serverTemplateId = "server-template-id"; WorkItemParameterSummary param1 = new WorkItemParameterSummary("param1", "value1"); WorkItemParameterSummary param2 = new WorkItemParameterSummary("param2", "value2"); WorkItemSummary workItemSummary = WorkItemSummary.builder() .id(workItemId) .name("Dynamic Task") .parameters(Arrays.asList(param1, param2)).build(); ProcessInstanceLogItemDetailsView workItemView = mock(ProcessInstanceLogItemDetailsView.class); when(processRuntimeDataServiceMock.getWorkItemByProcessInstanceId(serverTemplateId, containerId, processInstanceId, workItemId)).thenReturn(workItemSummary); presenter.setProcessInstance(ProcessInstanceSummary.builder().withServerTemplateId(serverTemplateId).withDeploymentId(containerId).withProcessInstanceId(processInstanceId).build()); presenter.loadWorkItemDetails(workItemId, workItemView); verify(processRuntimeDataServiceMock).getWorkItemByProcessInstanceId(serverTemplateId, containerId, processInstanceId, workItemId); verify(workItemView).setDetailsData(workItemSummary); }