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);
}
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;
}
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());
}
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);
}
}
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);
}
Aggregations