use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testOverwriteDeploymentSource.
public void testOverwriteDeploymentSource() {
String key = "process";
BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
Deployment deployment = repositoryService.createDeployment(processApplication.getReference()).name("first-deployment-with-a-source").source("my-source").addModelInstance("process.bpmn", model).deploy();
assertEquals("my-source", deploymentQuery.deploymentName("first-deployment-with-a-source").singleResult().getSource());
deleteDeployments(deployment);
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testNullDeploymentSourceAwareDuplicateFilter.
public void testNullDeploymentSourceAwareDuplicateFilter() {
// given
String key = "process";
String name = "my-deployment";
BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionKey(key);
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery().deploymentName(name);
// when
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name(name).source(null).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name(name).source(null).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
// then
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method createDeploymentForAnotherTenant.
@Test
public void createDeploymentForAnotherTenant() {
identityService.setAuthentication("user", null, null);
repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).tenantId(TENANT_ONE).deploy();
identityService.clearAuthentication();
DeploymentQuery query = repositoryService.createDeploymentQuery();
assertThat(query.count(), is(1L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method createDeploymentDisabledTenantCheck.
@Test
public void createDeploymentDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
repositoryService.createDeployment().addModelInstance("emptyProcessOne", emptyProcess).tenantId(TENANT_ONE).deploy();
repositoryService.createDeployment().addModelInstance("emptyProcessTwo", startEndProcess).tenantId(TENANT_TWO).deploy();
DeploymentQuery query = repositoryService.createDeploymentQuery();
assertThat(query.count(), is(2L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method createDeploymentWithAuthenticatedTenant.
@Test
public void createDeploymentWithAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).tenantId(TENANT_ONE).deploy();
identityService.clearAuthentication();
DeploymentQuery query = repositoryService.createDeploymentQuery();
assertThat(query.count(), is(1L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
Aggregations