use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method getResourceAsStreamDisabledTenantCheck.
@Test
public void getResourceAsStreamDisabledTenantCheck() {
Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);
Resource resourceOne = repositoryService.getDeploymentResources(deploymentOne.getId()).get(0);
Resource resourceTwo = repositoryService.getDeploymentResources(deploymentTwo.getId()).get(0);
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
InputStream inputStream = repositoryService.getResourceAsStream(deploymentOne.getId(), resourceOne.getName());
assertThat(inputStream, notNullValue());
inputStream = repositoryService.getResourceAsStream(deploymentTwo.getId(), resourceTwo.getName());
assertThat(inputStream, notNullValue());
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method getDeploymentResourcesDisabledTenantCheck.
@Test
public void getDeploymentResourcesDisabledTenantCheck() {
Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
List<Resource> deploymentResources = repositoryService.getDeploymentResources(deploymentOne.getId());
assertThat(deploymentResources, hasSize(1));
deploymentResources = repositoryService.getDeploymentResources(deploymentTwo.getId());
assertThat(deploymentResources, hasSize(1));
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method getResourceAsStreamByIdDisabledTenantCheck.
@Test
public void getResourceAsStreamByIdDisabledTenantCheck() {
Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);
Resource resourceOne = repositoryService.getDeploymentResources(deploymentOne.getId()).get(0);
Resource resourceTwo = repositoryService.getDeploymentResources(deploymentTwo.getId()).get(0);
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
InputStream inputStream = repositoryService.getResourceAsStreamById(deploymentOne.getId(), resourceOne.getId());
assertThat(inputStream, notNullValue());
inputStream = repositoryService.getResourceAsStreamById(deploymentTwo.getId(), resourceTwo.getId());
assertThat(inputStream, notNullValue());
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method failToGetDeploymentResourceNamesNoAuthenticatedTenant.
@Test
public void failToGetDeploymentResourceNamesNoAuthenticatedTenant() {
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.getDeploymentResourceNames(deployment.getId());
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentCmdsTenantCheckTest method deleteDeploymentDisabledTenantCheck.
@Test
public void deleteDeploymentDisabledTenantCheck() {
Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
repositoryService.deleteDeployment(deploymentOne.getId());
repositoryService.deleteDeployment(deploymentTwo.getId());
DeploymentQuery query = repositoryService.createDeploymentQuery();
assertThat(query.count(), is(0L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
}
Aggregations