Search in sources :

Example 1 with EmbeddedProcessApplication

use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.

the class DeploymentAuthorizationTest method testRegisterProcessApplicationAsCamundaAdmin.

public void testRegisterProcessApplicationAsCamundaAdmin() {
    // given
    identityService.setAuthentication(userId, Collections.singletonList(Groups.CAMUNDA_ADMIN));
    EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
    ProcessApplicationReference reference = processApplication.getReference();
    String deploymentId = createDeployment(null, FIRST_RESOURCE).getId();
    // when
    ProcessApplicationRegistration registration = managementService.registerProcessApplication(deploymentId, reference);
    // then
    assertNotNull(registration);
    assertNotNull(getProcessApplicationForDeployment(deploymentId));
    deleteDeployment(deploymentId);
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) ProcessApplicationRegistration(org.camunda.bpm.application.ProcessApplicationRegistration) EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication)

Example 2 with EmbeddedProcessApplication

use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.

the class DeploymentAuthorizationTest method testRegisterProcessApplicationWithoutAuthorization.

// register process application ///////////////////////////////////
public void testRegisterProcessApplicationWithoutAuthorization() {
    // given
    EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
    ProcessApplicationReference reference = processApplication.getReference();
    String deploymentId = createDeployment(null, FIRST_RESOURCE).getId();
    try {
        // when
        managementService.registerProcessApplication(deploymentId, reference);
        fail("Exception expected: It should not be possible to register a process application");
    } catch (AuthorizationException e) {
        // then
        String message = e.getMessage();
        assertTextPresent("ENGINE-03029 Required authenticated group 'camunda-admin'", message);
    }
    deleteDeployment(deploymentId);
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication) AuthorizationException(org.camunda.bpm.engine.AuthorizationException)

Example 3 with EmbeddedProcessApplication

use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.

the class DeploymentAuthorizationTest method testUnregisterProcessApplicationAsCamundaAdmin.

public void testUnregisterProcessApplicationAsCamundaAdmin() {
    // given
    identityService.setAuthentication(userId, Collections.singletonList(Groups.CAMUNDA_ADMIN));
    EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
    String deploymentId = createDeployment(null, FIRST_RESOURCE).getId();
    ProcessApplicationReference reference = processApplication.getReference();
    registerProcessApplication(deploymentId, reference);
    // when
    managementService.unregisterProcessApplication(deploymentId, true);
    // then
    assertNull(getProcessApplicationForDeployment(deploymentId));
    deleteDeployment(deploymentId);
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication)

Example 4 with EmbeddedProcessApplication

use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.

the class CmmnDisabledTest method setUp.

protected void setUp() throws Exception {
    processApplication = new EmbeddedProcessApplication();
    super.setUp();
}
Also used : EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication)

Example 5 with EmbeddedProcessApplication

use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.

the class RedeploymentRegistrationTest method init.

@Before
public void init() throws Exception {
    repositoryService = engineRule.getRepositoryService();
    processEngineConfiguration = engineRule.getProcessEngineConfiguration();
    processApplication = new EmbeddedProcessApplication();
}
Also used : EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication) Before(org.junit.Before)

Aggregations

EmbeddedProcessApplication (org.camunda.bpm.application.impl.EmbeddedProcessApplication)30 Deployment (org.camunda.bpm.engine.test.Deployment)11 DelegateExecution (org.camunda.bpm.engine.delegate.DelegateExecution)9 ExecutionListener (org.camunda.bpm.engine.delegate.ExecutionListener)9 ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)8 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)7 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)6 ScriptEngine (javax.script.ScriptEngine)5 ProcessApplicationRegistration (org.camunda.bpm.application.ProcessApplicationRegistration)4 DelegateTask (org.camunda.bpm.engine.delegate.DelegateTask)4 Task (org.camunda.bpm.engine.task.Task)4 ArrayList (java.util.ArrayList)3 AuthorizationException (org.camunda.bpm.engine.AuthorizationException)3 Resource (org.camunda.bpm.engine.repository.Resource)3 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)3 List (java.util.List)2 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)2 TaskListener (org.camunda.bpm.engine.delegate.TaskListener)1 UserOperationLogEntry (org.camunda.bpm.engine.history.UserOperationLogEntry)1 ExecutableScript (org.camunda.bpm.engine.impl.scripting.ExecutableScript)1