use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testDeleteAsyncWithSkipSubprocesses.
@Test
public void testDeleteAsyncWithSkipSubprocesses() {
when(runtimeServiceMock.deleteProcessInstancesAsync(anyListOf(String.class), any(ProcessInstanceQuery.class), anyString(), anyBoolean(), anyBoolean())).thenReturn(new BatchEntity());
Map<String, Object> messageBodyJson = new HashMap<String, Object>();
messageBodyJson.put("deleteReason", TEST_DELETE_REASON);
messageBodyJson.put("processInstanceIds", Arrays.asList("processInstanceId1", "processInstanceId2"));
messageBodyJson.put("skipSubprocesses", true);
given().contentType(ContentType.JSON).body(messageBodyJson).then().expect().statusCode(Status.OK.getStatusCode()).when().post(DELETE_PROCESS_INSTANCES_ASYNC_URL);
verify(runtimeServiceMock).deleteProcessInstancesAsync(anyListOf(String.class), Mockito.any(ProcessInstanceQuery.class), Mockito.eq(TEST_DELETE_REASON), Mockito.eq(false), Mockito.eq(true));
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testDeleteAsyncWithQuery.
@Test
public void testDeleteAsyncWithQuery() {
Map<String, Object> messageBodyJson = new HashMap<String, Object>();
messageBodyJson.put("deleteReason", TEST_DELETE_REASON);
ProcessInstanceQueryDto query = new ProcessInstanceQueryDto();
messageBodyJson.put("processInstanceQuery", query);
when(runtimeServiceMock.deleteProcessInstancesAsync(anyListOf(String.class), any(ProcessInstanceQuery.class), anyString(), anyBoolean(), anyBoolean())).thenReturn(new BatchEntity());
given().contentType(ContentType.JSON).body(messageBodyJson).then().expect().statusCode(Status.OK.getStatusCode()).when().post(DELETE_PROCESS_INSTANCES_ASYNC_URL);
verify(runtimeServiceMock, times(1)).deleteProcessInstancesAsync(anyListOf(String.class), Mockito.any(ProcessInstanceQuery.class), Mockito.eq(TEST_DELETE_REASON), Mockito.eq(false), Mockito.eq(false));
}
Aggregations