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));
}
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));
}
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));
}
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());
}
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());
}
Aggregations