use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method redeployForDifferentAuthenticatedTenantsDisabledTenantCheck.
@Test
public void redeployForDifferentAuthenticatedTenantsDisabledTenantCheck() {
Deployment deploymentOne = repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).addModelInstance("startEndProcess.bpmn", startEndProcess).tenantId(TENANT_ONE).deploy();
identityService.setAuthentication("user", null, null);
processEngineConfiguration.setTenantCheckEnabled(false);
repositoryService.createDeployment().addDeploymentResources(deploymentOne.getId()).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.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method getResourceAsStreamWithAuthenticatedTenant.
@Test
public void getResourceAsStreamWithAuthenticatedTenant() {
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.getResourceAsStream(deployment.getId(), resource.getName());
assertThat(inputStream, notNullValue());
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method failToGetResourceAsStreamByIdNoAuthenticatedTenant.
@Test
public void failToGetResourceAsStreamByIdNoAuthenticatedTenant() {
Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);
Resource resource = repositoryService.getDeploymentResources(deployment.getId()).get(0);
identityService.setAuthentication("user", null, null);
// declare expected exception
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("Cannot get the deployment");
repositoryService.getResourceAsStreamById(deployment.getId(), resource.getId());
}
use of org.camunda.bpm.engine.repository.Deployment 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.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method redeployForDifferentAuthenticatedTenants.
@Test
public void redeployForDifferentAuthenticatedTenants() {
Deployment deploymentOne = repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).addModelInstance("startEndProcess.bpmn", startEndProcess).tenantId(TENANT_ONE).deploy();
identityService.setAuthentication("user", null, Arrays.asList(TENANT_TWO));
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("Cannot get the deployment");
repositoryService.createDeployment().addDeploymentResources(deploymentOne.getId()).tenantId(TENANT_TWO).deploy();
}
Aggregations