RemoteProcessServiceImpl extends AbstractKieServerService implements ProcessService { @Override public void abortProcessInstances(String serverTemplateId, Map<String, List<Long>> containerInstances) { ProcessServicesClient client = getClient(serverTemplateId, ProcessServicesClient.class); containerInstances.forEach((container, instances) -> client.abortProcessInstances(container, instances) ); }  @Override void abortProcessInstance(ProcessInstanceKey processInstance); @Override void abortProcessInstances(String serverTemplateId,
                                      Map<String, List<Long>> containerInstances); @Override Long startProcess(String serverTemplateId,
                             String containerId,
                             String processId,
                             String correlationKey,
                             Map<String, Object> params); @Override List<String> getAvailableSignals(String serverTemplateId,
                                            String containerId,
                                            Long processInstanceId); @Override void signalProcessInstances(String serverTemplateId,
                                       List<String> containers,
                                       List<Long> processInstanceId,
                                       String signal,
                                       Object event); @Override void setProcessVariable(String serverTemplateId,
                                   String containerId,
                                   long processInstanceId,
                                   String variableName,
                                   String value);  }
@Test public void bulkAbortProcessInstancesTest_singleProcessInstance() { final String containerId = "containerId"; final Long processInstanceId = 1L; final Map<String, List<Long>> containerInstance = singletonMap(containerId, Arrays.asList(processInstanceId)); remoteProcessService.abortProcessInstances(SERVER_TEMPLATE_ID, containerInstance); verify(processServicesClientMock).abortProcessInstances(containerId, Arrays.asList(processInstanceId)); }
@Test public void bulkAbortProcessInstancesTest_multipleProcessInstancesOneContainer() { final String containerId = "containerId"; final List<Long> processInstanceIds = new ArrayList<>(Arrays.asList(1L, 2L)); final Map<String, List<Long>> containerInstance = singletonMap("containerId", Arrays.asList(1L, 2L)); remoteProcessService.abortProcessInstances(SERVER_TEMPLATE_ID, containerInstance); verify(processServicesClientMock).abortProcessInstances(containerId, processInstanceIds); }
@Test public void bulkAbortProcessInstancesTest_multipleProcessInstancesMultipleContainers() { final Map<String, List<Long>> containerInstance = new HashMap<>(); containerInstance.put("containerId_1", Arrays.asList(1L)); containerInstance.put("containerId_2", Arrays.asList(2L)); remoteProcessService.abortProcessInstances(SERVER_TEMPLATE_ID, containerInstance); verify(processServicesClientMock).abortProcessInstances("containerId_1", Arrays.asList(1L)); verify(processServicesClientMock).abortProcessInstances("containerId_2", Arrays.asList(2L)); verifyNoMoreInteractions(processServicesClientMock); }