BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doSkipInstanceInError(String processId, String processInstanceId) { return executeOnInstanceInError(processId, processInstanceId, processInstance -> { processInstance.error().get().skip(); if (processInstance.status() == ProcessInstance.STATE_ERROR) { throw new ProcessInstanceExecutionException(processInstance.id(), processInstance.error().get().failedNodeId(), processInstance.error().get().errorMessage()); } else { return buildOkResponse(processInstance.variables()); } }); } 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);  }
@Test void testDoSkipInstanceInError() { mockProcessInstanceStatusActiveOnError().skip(); Object response = tested.doSkipInstanceInError(PROCESS_ID, PROCESS_INSTANCE_ID); verify(processInstance, times(2)).error(); verify(error, times(0)).retrigger(); verify(error, times(1)).skip(); assertResultOk(response); }