use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class DeploymentQueryTest method testVerifyDeploymentProperties.
public void testVerifyDeploymentProperties() {
List<Deployment> deployments = repositoryService.createDeploymentQuery().orderByDeploymentName().asc().list();
Deployment deploymentOne = deployments.get(0);
assertEquals("org/camunda/bpm/engine/test/repository/one.bpmn20.xml", deploymentOne.getName());
assertEquals(deploymentOneId, deploymentOne.getId());
assertEquals(ProcessApplicationDeployment.PROCESS_APPLICATION_DEPLOYMENT_SOURCE, deploymentOne.getSource());
assertNull(deploymentOne.getTenantId());
Deployment deploymentTwo = deployments.get(1);
assertEquals("org/camunda/bpm/engine/test/repository/two_.bpmn20.xml", deploymentTwo.getName());
assertEquals(deploymentTwoId, deploymentTwo.getId());
assertNull(deploymentTwo.getSource());
assertNull(deploymentTwo.getTenantId());
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testDeploymentSourceShouldBeNull.
public void testDeploymentSourceShouldBeNull() {
String key = "process";
BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
Deployment deployment1 = repositoryService.createDeployment().name("first-deployment-without-a-source").addModelInstance("process.bpmn", model).deploy();
assertNull(deploymentQuery.deploymentName("first-deployment-without-a-source").singleResult().getSource());
Deployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("second-deployment-with-a-source").source(null).addModelInstance("process.bpmn", model).deploy();
assertNull(deploymentQuery.deploymentName("second-deployment-with-a-source").singleResult().getSource());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testDefaultDeploymentSource.
public void testDefaultDeploymentSource() {
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").addModelInstance("process.bpmn", model).deploy();
assertEquals(ProcessApplicationDeployment.PROCESS_APPLICATION_DEPLOYMENT_SOURCE, deploymentQuery.deploymentName("first-deployment-with-a-source").singleResult().getSource());
deleteDeployments(deployment);
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method getResourceAsStreamByIdWithAuthenticatedTenant.
@Test
public void getResourceAsStreamByIdWithAuthenticatedTenant() {
Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);
Resource resource = repositoryService.getDeploymentResources(deployment.getId()).get(0);
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
InputStream inputStream = repositoryService.getResourceAsStreamById(deployment.getId(), resource.getId());
assertThat(inputStream, notNullValue());
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method getDeploymentResourceNamesDisabledTenantCheck.
@Test
public void getDeploymentResourceNamesDisabledTenantCheck() {
Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
List<String> deploymentResourceNames = repositoryService.getDeploymentResourceNames(deploymentOne.getId());
assertThat(deploymentResourceNames, hasSize(1));
deploymentResourceNames = repositoryService.getDeploymentResourceNames(deploymentTwo.getId());
assertThat(deploymentResourceNames, hasSize(1));
}
Aggregations