public void testGetCompletedTasksWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getCompletedHistoricTaskInstances(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the tasks"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testGetOperationsLogWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getHistoricUserOperationLogs(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the logs"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testGetRunningActivitiesWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getRunningHistoricActivityInstances(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the activities"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testGetCompletedActivitiesWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getCompletedHistoricActivityInstances(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the activities"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testGetRunningProcessInstancesWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getRunningHistoricProcessInstances(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the activities"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testSuspendProcessDefinitionByKeyWithoutAuthorization() { // given try { // when repositoryService.suspendProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); fail("Exception expected: It should not be possible to suspend the process definition"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(UPDATE.getName(), message); assertTextPresent(ONE_TASK_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testSubmitStartFormWithoutAuthorization() { // given String processDefinitionId = selectProcessDefinitionByKey(FORM_PROCESS_KEY).getId(); try { // when formService.submitStartForm(processDefinitionId, null); fail("Exception expected: It should not possible to submit a start form"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(CREATE.getName(), message); assertTextPresent(PROCESS_INSTANCE.resourceName(), message); } }
public void testActivateProcessDefinitionByKeyWithoutAuthorization() { // given suspendProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); try { // when repositoryService.activateProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); fail("Exception expected: It should not be possible to activate the process definition"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(UPDATE.getName(), message); assertTextPresent(ONE_TASK_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testDeleteDeploymentWithoutAuthorization() { // given String deploymentId = createDeployment(null); try { // when repositoryService.deleteDeployment(deploymentId); fail("Exception expected: it should not be possible to delete a deployment"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(DELETE.getName(), message); assertTextPresent(DEPLOYMENT.resourceName(), message); } deleteDeployment(deploymentId); }
public void testGetDeploymentResourcesWithoutAuthorization() { // given String deploymentId = createDeployment(null); try { // when repositoryService.getDeploymentResources(deploymentId); fail("Exception expected: it should not be possible to retrieve deployment resources"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(DEPLOYMENT.resourceName(), message); } deleteDeployment(deploymentId); }
public void testGetStartFormVariablesWithoutAuthorization() { // given String processDefinitionId = selectProcessDefinitionByKey(RENDERED_FORM_PROCESS_KEY).getId(); try { // when formService.getStartFormVariables(processDefinitionId); fail("Exception expected: It should not be possible to get start form data"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(RENDERED_FORM_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testSubmitStartFormWithCreateInstancePermissionOnProcessDefinition() { // given String processDefinitionId = selectProcessDefinitionByKey(FORM_PROCESS_KEY).getId(); createGrantAuthorization(PROCESS_DEFINITION, FORM_PROCESS_KEY, userId, CREATE_INSTANCE); try { // when formService.submitStartForm(processDefinitionId, null); fail("Exception expected: It should not possible to submit a start form"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(CREATE.getName(), message); assertTextPresent(PROCESS_INSTANCE.resourceName(), message); } }
public void testGetStartFormKeyWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(FORM_PROCESS_KEY).getId(); try { // when formService.getStartFormKey(processDefinitionId); fail("Exception expected: It should not possible to get a start form key"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(FORM_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetBpmnModelInstanceWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY).getId(); try { // when repositoryService.getBpmnModelInstance(processDefinitionId); fail("Exception expected: It should not be possible to get the bpmn model instance"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(ONE_TASK_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetDecisionModelWithoutAuthorizations() { // given String decisionDefinitionId = selectDecisionDefinitionByKey(DECISION_DEFINITION_KEY).getId(); try { // when repositoryService.getDecisionModel(decisionDefinitionId); fail("Exception expected"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(DECISION_DEFINITION_KEY, message); assertTextPresent(DECISION_DEFINITION.resourceName(), message); } }
public void testDecisionDefinitionUpdateTimeToLiveWithoutAuthorizations() { //given String decisionDefinitionId = selectDecisionDefinitionByKey(DECISION_DEFINITION_KEY).getId(); try { //when repositoryService.updateDecisionDefinitionHistoryTimeToLive(decisionDefinitionId, 6); fail("Exception expected"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(UPDATE.getName(), message); assertTextPresent(DECISION_DEFINITION_KEY, message); assertTextPresent(DECISION_DEFINITION.resourceName(), message); } }
public void testSuspendByProcessDefinitionIdWithoutAuthorization() { // given String processDefinitionId = selectProcessDefinitionByKey(TIMER_BOUNDARY_PROCESS_KEY).getId(); try { // when managementService.suspendJobDefinitionByProcessDefinitionId(processDefinitionId); fail("Exception expected: It should not be possible to suspend a job definition"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(UPDATE.getName(), message); assertTextPresent(TIMER_BOUNDARY_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetStartFormDataWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(FORM_PROCESS_KEY).getId(); try { // when formService.getStartFormData(processDefinitionId); fail("Exception expected: It should not be possible to get start form data"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(FORM_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetProcessModelWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY).getId(); try { // when repositoryService.getProcessModel(processDefinitionId); fail("Exception expected: It should not be possible to get the process model"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(ONE_TASK_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetDecisionDiagramWithoutAuthorizations() { // given String decisionDefinitionId = selectDecisionDefinitionByKey(DECISION_DEFINITION_KEY).getId(); try { // when repositoryService.getDecisionDiagram(decisionDefinitionId); fail("Exception expected"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(DECISION_DEFINITION_KEY, message); assertTextPresent(DECISION_DEFINITION.resourceName(), message); } }