@Test void testDoGetWorkItemsInProcessInstance(@Mock WorkItem workItem) { when(processInstance.workItems(any(SecurityPolicy.class))).thenReturn(singletonList(workItem)); Object response = tested.doGetWorkItemsInProcessInstance(PROCESS_ID, PROCESS_INSTANCE_ID); assertThat(response).isInstanceOf(List.class); assertThat(((List)response).get(0)).isEqualTo(workItem); }
public T doGetWorkItemsInProcessInstance(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { List<WorkItem> workItems = processInstance.workItems(new SecurityPolicy(null) { }); return buildOkResponse(workItems); }); }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doGetWorkItemsInProcessInstance(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { List<WorkItem> workItems = processInstance.workItems(new SecurityPolicy(null) { }); return buildOkResponse(workItems); }); } }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doGetWorkItemsInProcessInstance(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { List<WorkItem> workItems = processInstance.workItems(new SecurityPolicy(null) { }); return buildOkResponse(workItems); }); } BaseProcessInstanceManagementResource(Processes processes, Application application); }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doGetWorkItemsInProcessInstance(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { List<WorkItem> workItems = processInstance.workItems(new SecurityPolicy(null) { }); return buildOkResponse(workItems); }); } BaseProcessInstanceManagementResource(Processes processes, Application application); T doGetProcessNodes(String processId); T doGetInstanceInError(String processId, String processInstanceId); T doGetWorkItemsInProcessInstance(String processId, String processInstanceId); T doRetriggerInstanceInError(String processId, String processInstanceId); T doSkipInstanceInError(String processId, String processInstanceId); T doTriggerNodeInstanceId(String processId, String processInstanceId, String nodeId); T doRetriggerNodeInstanceId(String processId, String processInstanceId, String nodeInstanceId); T doCancelNodeInstanceId(String processId, String processInstanceId, String nodeInstanceId); T doCancelProcessInstanceId(String processId, String processInstanceId); }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doGetWorkItemsInProcessInstance(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { List<WorkItem> workItems = processInstance.workItems(new SecurityPolicy(null) { }); return buildOkResponse(workItems); }); } BaseProcessInstanceManagementResource(Processes processes, Application application); T doGetProcessNodes(String processId); T doGetInstanceInError(String processId, String processInstanceId); T doGetWorkItemsInProcessInstance(String processId, String processInstanceId); T doRetriggerInstanceInError(String processId, String processInstanceId); T doSkipInstanceInError(String processId, String processInstanceId); T doTriggerNodeInstanceId(String processId, String processInstanceId, String nodeId); T doRetriggerNodeInstanceId(String processId, String processInstanceId, String nodeInstanceId); T doCancelNodeInstanceId(String processId, String processInstanceId, String nodeInstanceId); T doCancelProcessInstanceId(String processId, String processInstanceId);  }