use of org.camunda.bpm.engine.rest.dto.runtime.batch.DeleteProcessInstancesDto 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.rest.dto.runtime.batch.DeleteProcessInstancesDto in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testDeleteAsyncHistoricQueryBasedWithoutQueryAndWithoutProcessInstanceIds.
@Test
public void testDeleteAsyncHistoricQueryBasedWithoutQueryAndWithoutProcessInstanceIds() {
doThrow(new BadUserRequestException("processInstanceIds is empty")).when(runtimeServiceMock).deleteProcessInstancesAsync(anyListOf(String.class), eq((ProcessInstanceQuery) null), anyString(), anyBoolean(), anyBoolean());
given().contentType(ContentType.JSON).body(new DeleteProcessInstancesDto()).then().expect().statusCode(Status.BAD_REQUEST.getStatusCode()).when().post(DELETE_PROCESS_INSTANCES_ASYNC_HIST_QUERY_URL);
verify(runtimeServiceMock, times(1)).deleteProcessInstancesAsync(new ArrayList<String>(), null, null, false, false);
}
use of org.camunda.bpm.engine.rest.dto.runtime.batch.DeleteProcessInstancesDto 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.rest.dto.runtime.batch.DeleteProcessInstancesDto in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testDeleteAsyncHistoricQueryBasedWithSkipCustomListenerTrue.
@Test
public void testDeleteAsyncHistoricQueryBasedWithSkipCustomListenerTrue() {
when(runtimeServiceMock.deleteProcessInstancesAsync(anyListOf(String.class), any(ProcessInstanceQuery.class), anyString(), anyBoolean(), anyBoolean())).thenReturn(new BatchEntity());
DeleteProcessInstancesDto body = new DeleteProcessInstancesDto();
body.setSkipCustomListeners(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, true, false);
}
use of org.camunda.bpm.engine.rest.dto.runtime.batch.DeleteProcessInstancesDto in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testDeleteAsyncHistoricQueryBasedWithProcessInstanceIds.
@Test
public void testDeleteAsyncHistoricQueryBasedWithProcessInstanceIds() {
when(runtimeServiceMock.deleteProcessInstancesAsync(anyListOf(String.class), any(ProcessInstanceQuery.class), anyString(), anyBoolean(), anyBoolean())).thenReturn(new BatchEntity());
DeleteProcessInstancesDto body = new DeleteProcessInstancesDto();
body.setProcessInstanceIds(Arrays.asList(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID));
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(Arrays.asList(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID), null, null, false, false);
}
Aggregations