use of org.camunda.bpm.engine.repository.Deployment 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.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method getDeploymentResourceNamesWithAuthenticatedTenant.
@Test
public void getDeploymentResourceNamesWithAuthenticatedTenant() {
Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
List<String> deploymentResourceNames = repositoryService.getDeploymentResourceNames(deployment.getId());
assertThat(deploymentResourceNames, hasSize(1));
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method failToDeleteDeploymentNoAuthenticatedTenant.
@Test
public void failToDeleteDeploymentNoAuthenticatedTenant() {
Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);
identityService.setAuthentication("user", null, null);
// declare expected exception
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("Cannot delete the deployment");
repositoryService.deleteDeployment(deployment.getId());
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method getDeploymentResourcesWithAuthenticatedTenant.
@Test
public void getDeploymentResourcesWithAuthenticatedTenant() {
Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
List<Resource> deploymentResources = repositoryService.getDeploymentResources(deployment.getId());
assertThat(deploymentResources, hasSize(1));
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method failToGetDeploymentResourcesNoAuthenticatedTenant.
@Test
public void failToGetDeploymentResourcesNoAuthenticatedTenant() {
Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);
identityService.setAuthentication("user", null, null);
// declare expected exception
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("Cannot get the deployment");
repositoryService.getDeploymentResources(deployment.getId());
}
Aggregations