Search in sources :

Example 1 with Deployment

use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.

the class ProcessEngineRestServiceTest method createDeploymentMock.

private void createDeploymentMock() {
    Deployment mockDeployment = MockProvider.createMockDeployment();
    DeploymentQuery deploymentQueryMock = mock(DeploymentQuery.class);
    when(deploymentQueryMock.deploymentId(anyString())).thenReturn(deploymentQueryMock);
    when(deploymentQueryMock.singleResult()).thenReturn(mockDeployment);
    when(mockRepoService.createDeploymentQuery()).thenReturn(deploymentQueryMock);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) Deployment(org.camunda.bpm.engine.repository.Deployment)

Example 2 with Deployment

use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.

the class ScopingTest method after.

@After
public void after() {
    for (Deployment deployment : repositoryService.createDeploymentQuery().list()) {
        repositoryService.deleteDeployment(deployment.getId(), true);
    }
    processEngine.close();
    processEngine = null;
    repositoryService = null;
    taskService = null;
    processInitiatingPojo = null;
}
Also used : Deployment(org.camunda.bpm.engine.repository.Deployment) After(org.junit.After)

Example 3 with Deployment

use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.

the class DeploymentAuthorizationTest method testCreateAuthorizationOnDeploy.

// should create authorization /////////////////////////////////////
public void testCreateAuthorizationOnDeploy() {
    // given
    createGrantAuthorization(DEPLOYMENT, ANY, userId, CREATE);
    Deployment deployment = repositoryService.createDeployment().addClasspathResource(FIRST_RESOURCE).deploy();
    // when
    Authorization authorization = authorizationService.createAuthorizationQuery().userIdIn(userId).resourceId(deployment.getId()).singleResult();
    // then
    assertNotNull(authorization);
    assertTrue(authorization.isPermissionGranted(READ));
    assertTrue(authorization.isPermissionGranted(DELETE));
    assertFalse(authorization.isPermissionGranted(UPDATE));
    deleteDeployment(deployment.getId());
}
Also used : Authorization(org.camunda.bpm.engine.authorization.Authorization) Deployment(org.camunda.bpm.engine.repository.Deployment)

Example 4 with Deployment

use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.

the class RedeploymentProcessApplicationTest method deleteDeployments.

protected void deleteDeployments(Deployment... deployments) {
    for (Deployment deployment : deployments) {
        repositoryService.deleteDeployment(deployment.getId(), true);
        managementService.unregisterProcessApplication(deployment.getId(), false);
    }
}
Also used : Deployment(org.camunda.bpm.engine.repository.Deployment)

Example 5 with Deployment

use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.

the class RedeploymentProcessApplicationTest method definitionTwoPreviousDeploymentWithPA.

@Test
public void definitionTwoPreviousDeploymentWithPA() {
    // given
    // first deployment
    MyEmbeddedProcessApplication application1 = new MyEmbeddedProcessApplication();
    Deployment deployment1 = repositoryService.createDeployment(application1.getReference()).name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy();
    // second deployment
    MyEmbeddedProcessApplication application2 = new MyEmbeddedProcessApplication();
    Deployment deployment2 = repositoryService.createDeployment(application2.getReference()).name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy();
    // second deployment
    Deployment deployment3 = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.getId()).deploy();
    assertEquals(3, testProvider.countDefinitionsByKey(definitionKey1));
    // when
    testProvider.createInstanceByDefinitionKey(definitionKey1);
    // then
    assertFalse(application1.isCalled());
    assertTrue(application2.isCalled());
    deleteDeployments(deployment1, deployment2, deployment3);
}
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