Search in sources :

Example 91 with Deployment

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);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) Deployment(org.camunda.bpm.engine.repository.Deployment) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance)

Example 92 with 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));
}
Also used : Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 93 with Deployment

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());
}
Also used : Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 94 with Deployment

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));
}
Also used : Resource(org.camunda.bpm.engine.repository.Resource) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 95 with Deployment

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());
}
Also used : Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Aggregations

Deployment (org.camunda.bpm.engine.repository.Deployment)137 Test (org.junit.Test)62 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)39 ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)36 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)19 Resource (org.camunda.bpm.engine.repository.Resource)19 InputStream (java.io.InputStream)14 DeploymentBuilder (org.camunda.bpm.engine.repository.DeploymentBuilder)11 DeploymentQuery (org.camunda.bpm.engine.repository.DeploymentQuery)11 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)10 UserOperationLogQuery (org.camunda.bpm.engine.history.UserOperationLogQuery)10 JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)10 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)9 UserOperationLogEntry (org.camunda.bpm.engine.history.UserOperationLogEntry)8 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)8 RepositoryService (org.camunda.bpm.engine.RepositoryService)4 Job (org.camunda.bpm.engine.runtime.Job)4 Response (com.jayway.restassured.response.Response)3 HashMap (java.util.HashMap)2 Authorization (org.camunda.bpm.engine.authorization.Authorization)2