Search in sources :

Example 46 with DeploymentQuery

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

the class MultiTenancyDeploymentCmdsTenantCheckTest method deleteDeploymentDisabledTenantCheck.

@Test
public void deleteDeploymentDisabledTenantCheck() {
    Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
    Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);
    processEngineConfiguration.setTenantCheckEnabled(false);
    identityService.setAuthentication("user", null, null);
    repositoryService.deleteDeployment(deploymentOne.getId());
    repositoryService.deleteDeployment(deploymentTwo.getId());
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    assertThat(query.count(), is(0L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
    assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 47 with DeploymentQuery

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

the class MultiTenancyDeploymentCmdsTenantCheckTest method deleteDeploymentWithAuthenticatedTenant.

@Test
public void deleteDeploymentWithAuthenticatedTenant() {
    Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    repositoryService.deleteDeployment(deployment.getId());
    identityService.clearAuthentication();
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    assertThat(query.count(), is(0L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 48 with DeploymentQuery

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

the class MultiTenancyDeploymentQueryTest method testQueryAuthenticatedTenant.

public void testQueryAuthenticatedTenant() {
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    assertThat(query.count(), is(2L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
    assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
    assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).includeDeploymentsWithoutTenantId().count(), is(2L));
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 49 with DeploymentQuery

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

the class TestWarDeploymentWithMultiplePasAsSubdeployment5 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 50 with DeploymentQuery

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

the class TestWarDeploymentWithMultiplePasAsSubdeployment1 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)

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