use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testDeleteAsyncHistoricQueryBasedWithSkipSubprocesses.
@Test
public void testDeleteAsyncHistoricQueryBasedWithSkipSubprocesses() {
when(runtimeServiceMock.deleteProcessInstancesAsync(anyListOf(String.class), any(ProcessInstanceQuery.class), anyString(), anyBoolean(), anyBoolean())).thenReturn(new BatchEntity());
DeleteProcessInstancesDto body = new DeleteProcessInstancesDto();
body.setSkipSubprocesses(true);
given().contentType(ContentType.JSON).body(body).then().expect().statusCode(Status.OK.getStatusCode()).when().post(DELETE_PROCESS_INSTANCES_ASYNC_HIST_QUERY_URL);
verify(runtimeServiceMock, times(1)).deleteProcessInstancesAsync(new ArrayList<String>(), null, null, false, true);
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testSuspendAsyncWithMultipleGroupOperations.
@Test
public void testSuspendAsyncWithMultipleGroupOperations() {
List<String> ids = Arrays.asList(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID);
ProcessInstanceQueryDto query = new ProcessInstanceQueryDto();
Map<String, Object> messageBodyJson = new HashMap<String, Object>();
messageBodyJson.put("processInstanceIds", ids);
messageBodyJson.put("processInstanceQuery", query);
messageBodyJson.put("suspended", true);
when(mockUpdateProcessInstancesSuspensionStateBuilder.suspendAsync()).thenReturn(new BatchEntity());
given().contentType(ContentType.JSON).body(messageBodyJson).then().expect().statusCode(Status.OK.getStatusCode()).when().post(PROCESS_INSTANCE_SUSPENDED_ASYNC_URL);
verify(mockUpdateSuspensionStateSelectBuilder).byProcessInstanceIds(ids);
verify(mockUpdateProcessInstancesSuspensionStateBuilder).byProcessInstanceQuery(query.toQuery(processEngine));
verify(mockUpdateProcessInstancesSuspensionStateBuilder).suspendAsync();
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testActivateAsyncWithHistoricProcessInstanceQuery.
@Test
public void testActivateAsyncWithHistoricProcessInstanceQuery() {
Map<String, Object> messageBodyJson = new HashMap<String, Object>();
List<String> ids = Arrays.asList(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID);
messageBodyJson.put("processInstanceIds", ids);
messageBodyJson.put("suspended", false);
when(mockUpdateProcessInstancesSuspensionStateBuilder.activateAsync()).thenReturn(new BatchEntity());
given().contentType(ContentType.JSON).body(messageBodyJson).then().expect().statusCode(Status.OK.getStatusCode()).when().post(PROCESS_INSTANCE_SUSPENDED_ASYNC_URL);
verify(mockUpdateSuspensionStateSelectBuilder).byProcessInstanceIds(ids);
verify(mockUpdateProcessInstancesSuspensionStateBuilder).activateAsync();
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testDeleteAsyncHistoricQueryBasedWithDeleteReason.
@Test
public void testDeleteAsyncHistoricQueryBasedWithDeleteReason() {
when(runtimeServiceMock.deleteProcessInstancesAsync(anyListOf(String.class), any(ProcessInstanceQuery.class), anyString(), anyBoolean(), anyBoolean())).thenReturn(new BatchEntity());
DeleteProcessInstancesDto body = new DeleteProcessInstancesDto();
body.setDeleteReason(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_DELETE_REASON);
given().contentType(ContentType.JSON).body(body).then().expect().statusCode(Status.OK.getStatusCode()).when().post(DELETE_PROCESS_INSTANCES_ASYNC_HIST_QUERY_URL);
verify(runtimeServiceMock, times(1)).deleteProcessInstancesAsync(new ArrayList<String>(), null, MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_DELETE_REASON, false, false);
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testActivateAsyncWithProcessInstances.
@Test
public void testActivateAsyncWithProcessInstances() {
Map<String, Object> messageBodyJson = new HashMap<String, Object>();
List<String> ids = Arrays.asList(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID);
messageBodyJson.put("processInstanceIds", ids);
messageBodyJson.put("suspended", false);
when(mockUpdateProcessInstancesSuspensionStateBuilder.activateAsync()).thenReturn(new BatchEntity());
given().contentType(ContentType.JSON).body(messageBodyJson).then().expect().statusCode(Status.OK.getStatusCode()).when().post(PROCESS_INSTANCE_SUSPENDED_ASYNC_URL);
verify(mockUpdateSuspensionStateSelectBuilder).byProcessInstanceIds(ids);
verify(mockUpdateProcessInstancesSuspensionStateBuilder).activateAsync();
}
Aggregations