Search in sources :

Example 1 with DeleteProcessDefinitionsBuilder

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();
}
Also used : DeleteProcessDefinitionsBuilder(org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder) Test(org.junit.Test)

Example 2 with DeleteProcessDefinitionsBuilder

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();
}
Also used : DeleteProcessDefinitionsBuilder(org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder) Test(org.junit.Test)

Example 3 with DeleteProcessDefinitionsBuilder

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();
}
Also used : DeleteProcessDefinitionsBuilder(org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder) Test(org.junit.Test)

Example 4 with DeleteProcessDefinitionsBuilder

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);
}
Also used : DeleteProcessDefinitionsBuilder(org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder) Test(org.junit.Test)

Example 5 with DeleteProcessDefinitionsBuilder

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();
}
Also used : DeleteProcessDefinitionsBuilder(org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder) Test(org.junit.Test)

Aggregations

DeleteProcessDefinitionsBuilder (org.camunda.bpm.engine.repository.DeleteProcessDefinitionsBuilder)12 Test (org.junit.Test)10 RepositoryService (org.camunda.bpm.engine.RepositoryService)2 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)1