Search in sources :

Example 51 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class TestWarDeploymentWithMultiplePasAsSubdeployment2 method assertProcessDeployed.

protected void assertProcessDeployed(String processKey, String expectedDeploymentName) {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().latestVersion().processDefinitionKey(processKey).singleResult();
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery().deploymentId(processDefinition.getDeploymentId());
    Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition)

Example 52 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentAuthorizationTest method testDeleteDeploymentWithDeletePermissionOnAnyDeployment.

public void testDeleteDeploymentWithDeletePermissionOnAnyDeployment() {
    // given
    String deploymentId = createDeployment(null);
    createGrantAuthorization(DEPLOYMENT, ANY, userId, DELETE);
    // when
    repositoryService.deleteDeployment(deploymentId);
    // then
    disableAuthorization();
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    verifyQueryResults(query, 0);
    enableAuthorization();
    deleteDeployment(deploymentId);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 53 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentAuthorizationTest method testDeploymentQueryWithReadPermissionOnDeployment.

public void testDeploymentQueryWithReadPermissionOnDeployment() {
    // given
    String deploymentId1 = createDeployment("first");
    String deploymentId2 = createDeployment("second");
    createGrantAuthorization(DEPLOYMENT, deploymentId1, userId, READ);
    // when
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    // then
    verifyQueryResults(query, 1);
    deleteDeployment(deploymentId1);
    deleteDeployment(deploymentId2);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 54 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentAuthorizationTest method testSimpleDeploymentQueryWithReadPermissionOnAnyDeployment.

public void testSimpleDeploymentQueryWithReadPermissionOnAnyDeployment() {
    // given
    String deploymentId = createDeployment(null);
    createGrantAuthorization(DEPLOYMENT, ANY, userId, READ);
    // when
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    // then
    verifyQueryResults(query, 1);
    deleteDeployment(deploymentId);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 55 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentAuthorizationTest method testSimpleDeploymentQueryWithoutAuthorization.

// query ////////////////////////////////////////////////////////////
public void testSimpleDeploymentQueryWithoutAuthorization() {
    // given
    String deploymentId = createDeployment(null);
    // when
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    // then
    verifyQueryResults(query, 0);
    deleteDeployment(deploymentId);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Aggregations

DeploymentQuery (org.camunda.bpm.engine.repository.DeploymentQuery)58 ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)13 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)13 Deployment (org.camunda.bpm.engine.repository.Deployment)11 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)8 Test (org.junit.Test)7 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)5 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)4