use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testDeleteDefinitionsByKeyNotExistingKey.
@Test
public void testDeleteDefinitionsByKeyNotExistingKey() {
DeleteProcessDefinitionsBuilder builder = repositoryServiceMock.deleteProcessDefinitions().byKey("NOT_EXISTING_KEY");
doThrow(new NotFoundException("No process definition found with key 'NOT_EXISTING_KEY'")).when(builder).delete();
given().pathParam("key", "NOT_EXISTING_KEY").expect().statusCode(Status.NOT_FOUND.getStatusCode()).body(containsString("No process definition found with key 'NOT_EXISTING_KEY'")).when().delete(SINGLE_PROCESS_DEFINITION_BY_KEY_DELETE_URL);
}
use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testDeleteDefinitionsByKeySkipCustomListenersWithTenantId.
@Test
public void testDeleteDefinitionsByKeySkipCustomListenersWithTenantId() {
given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).pathParam("tenant-id", MockProvider.EXAMPLE_TENANT_ID).queryParam("skipCustomListeners", true).expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().delete(SINGLE_PROCESS_DEFINITION_BY_KEY_AND_TENANT_ID_DELETE_URL);
DeleteProcessDefinitionsBuilder builder = repositoryServiceMock.deleteProcessDefinitions().byKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).withTenantId(MockProvider.EXAMPLE_TENANT_ID).skipCustomListeners();
verify(builder).delete();
}
use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceImpl method deleteProcessDefinitionsByKey.
@Override
public void deleteProcessDefinitionsByKey(String processDefinitionKey, boolean cascade, boolean skipCustomListeners) {
RepositoryService repositoryService = processEngine.getRepositoryService();
DeleteProcessDefinitionsBuilder builder = repositoryService.deleteProcessDefinitions().byKey(processDefinitionKey);
deleteProcessDefinitions(builder, cascade, skipCustomListeners);
}
use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceImpl method deleteProcessDefinitionsByKeyAndTenantId.
@Override
public void deleteProcessDefinitionsByKeyAndTenantId(String processDefinitionKey, boolean cascade, boolean skipCustomListeners, String tenantId) {
RepositoryService repositoryService = processEngine.getRepositoryService();
DeleteProcessDefinitionsBuilder builder = repositoryService.deleteProcessDefinitions().byKey(processDefinitionKey).withTenantId(tenantId);
deleteProcessDefinitions(builder, cascade, skipCustomListeners);
}
use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testDeleteDefinitionsByKeyCascadeWithTenantId.
@Test
public void testDeleteDefinitionsByKeyCascadeWithTenantId() {
given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).pathParam("tenant-id", MockProvider.EXAMPLE_TENANT_ID).queryParam("cascade", true).expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().delete(SINGLE_PROCESS_DEFINITION_BY_KEY_AND_TENANT_ID_DELETE_URL);
DeleteProcessDefinitionsBuilder builder = repositoryServiceMock.deleteProcessDefinitions().byKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).withTenantId(MockProvider.EXAMPLE_TENANT_ID).cascade();
verify(builder).delete();
}
Aggregations