use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method redeployForTheSameAuthenticatedTenant.
@Test
public void redeployForTheSameAuthenticatedTenant() {
Deployment deploymentOne = repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).addModelInstance("startEndProcess.bpmn", startEndProcess).tenantId(TENANT_ONE).deploy();
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
repositoryService.createDeployment().addDeploymentResources(deploymentOne.getId()).tenantId(TENANT_ONE).deploy();
DeploymentQuery query = repositoryService.createDeploymentQuery();
assertThat(query.count(), is(2L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ConcurrentDeploymentTest method testDuplicateFiltering.
/**
* @see https://app.camunda.com/jira/browse/CAM-2128
*/
public void testDuplicateFiltering() throws InterruptedException {
deployOnTwoConcurrentThreads(createDeploymentBuilder().enableDuplicateFiltering(false), createDeploymentBuilder().enableDuplicateFiltering(false));
// ensure that although both transactions were run concurrently, only one deployment was constructed.
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
assertThat(deploymentQuery.count(), is(1L));
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class TestWarDeploymentWithMultiplePasAsSubdeployment4 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 TestWarDeploymentWithMultiplePasAsSubdeployment3 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 MultiTenancyDeploymentQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
DeploymentQuery query = repositoryService.createDeploymentQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
Aggregations