use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testDeleteDefinitionsByKeySkipCustomListenersAndCascadeWithTenantId.
@Test
public void testDeleteDefinitionsByKeySkipCustomListenersAndCascadeWithTenantId() {
given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).queryParam("skipCustomListeners", true).queryParam("cascade", true).pathParam("tenant-id", MockProvider.EXAMPLE_TENANT_ID).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().cascade();
verify(builder).delete();
}
use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testDeleteDefinitionsByKeyCascade.
@Test
public void testDeleteDefinitionsByKeyCascade() {
given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).queryParam("cascade", true).expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().delete(SINGLE_PROCESS_DEFINITION_BY_KEY_DELETE_URL);
DeleteProcessDefinitionsBuilder builder = repositoryServiceMock.deleteProcessDefinitions().byKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).cascade();
verify(builder).delete();
}
use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testDeleteDefinitionsByKeySkipCustomListenersAndCascade.
@Test
public void testDeleteDefinitionsByKeySkipCustomListenersAndCascade() {
given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).queryParam("cascade", true).queryParam("skipCustomListeners", true).expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().delete(SINGLE_PROCESS_DEFINITION_BY_KEY_DELETE_URL);
DeleteProcessDefinitionsBuilder builder = repositoryServiceMock.deleteProcessDefinitions().byKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).skipCustomListeners().cascade();
verify(builder).delete();
}
use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testDeleteDefinitionsByKeyNoPermissions.
@Test
public void testDeleteDefinitionsByKeyNoPermissions() {
DeleteProcessDefinitionsBuilder builder = repositoryServiceMock.deleteProcessDefinitions().byKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).withTenantId(MockProvider.EXAMPLE_TENANT_ID);
doThrow(new AuthorizationException("No permission to delete process definitions")).when(builder).delete();
given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).pathParam("tenant-id", MockProvider.EXAMPLE_TENANT_ID).expect().statusCode(Status.FORBIDDEN.getStatusCode()).body(containsString("No permission to delete process definitions")).when().delete(SINGLE_PROCESS_DEFINITION_BY_KEY_AND_TENANT_ID_DELETE_URL);
}
use of org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testDeleteDefinitionsByKeyWithTenantId.
@Test
public void testDeleteDefinitionsByKeyWithTenantId() {
given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).pathParam("tenant-id", MockProvider.EXAMPLE_TENANT_ID).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);
verify(builder).delete();
}
Aggregations