Beispiel #1
0
        public virtual void getCaseModelDisabledTenantCheck()
        {
            processEngineConfiguration.SetTenantCheckEnabled(false);
            identityService.SetAuthentication("user", null, null);

            System.IO.Stream inputStream = repositoryService.GetCaseModel(caseDefinitionId);

            Assert.That(inputStream != null);
        }
        public virtual void getDecisionRequirementsDefinitionDisabledTenantCheck()
        {
            processEngineConfiguration.SetTenantCheckEnabled(false);
            identityService.SetAuthentication("user", null, null);

            IDecisionRequirementsDefinition definition = repositoryService.GetDecisionRequirementsDefinition(decisionRequirementsDefinitionId);

            Assert.That(definition.TenantId, Is.EqualTo(TENANT_ONE));
        }
Beispiel #3
0
        public virtual void getDurationReportByMonthDisabledTenantCheck()
        {
            testRule.DeployForTenant(TENANT_ONE, BPMN_PROCESS);

            startAndCompleteProcessInstance(null);

            identityService.SetAuthentication("user", null, null);
            processEngineConfiguration.SetTenantCheckEnabled(false);

            IList <IDurationReportResult> result = historyService.CreateHistoricProcessInstanceReport().Duration(PeriodUnit.Month);

            Assert.That(result.Count, Is.EqualTo(1));
        }
        public virtual void activeProcessInstancesCountWithDisabledTenantCheck()
        {
            testRule.Deploy(oneTaskProcess);

            startProcessInstances(ONE_TASK_PROCESS_DEFINITION_KEY);

            processEngineConfiguration.SetTenantCheckEnabled(false);
            identityService.SetAuthentication("user", null, null);

            IList <IDeploymentStatistics> deploymentStatistics = managementService.CreateDeploymentStatisticsQuery().ToList();

            // then
            Assert.AreEqual(1, deploymentStatistics.Count);
            Assert.AreEqual(3, deploymentStatistics[0].Instances);
        }
        public virtual void cleanUp()
        {
            processEngineConfiguration.SetTenantCheckEnabled(false);

            foreach (string taskId in taskIds)
            {
                taskService.DeleteTask(taskId, true);
            }
        }
        public virtual void setUp()
        {
            taskService                = processEngineRule.TaskService;
            identityService            = processEngineRule.IdentityService;
            authorizationService       = processEngineRule.IAuthorizationService;
            processEngineConfiguration = processEngineRule.ProcessEngineConfiguration;

            createTask(groupId, tenantId);
            createTask(groupId, anotherTenantId);
            createTask(groupId, anotherTenantId);

            processEngineConfiguration.SetTenantCheckEnabled(true);
        }
        [Test]   public virtual void testGetStartFormWithDisabledTenantCheck()
        {
            testRule.DeployForTenant(TENANT_ONE, "resources/api/authorization/formKeyProcess.bpmn20.xml");

            IProcessInstance instance = runtimeService.StartProcessInstanceByKey(PROCESS_DEFINITION_KEY);

            identityService.SetAuthentication("aUserId", null);
            processEngineConfiguration.SetTenantCheckEnabled(false);

            IStartFormData startFormData = formService.GetStartFormData(instance.ProcessDefinitionId);

            // then
            Assert.NotNull(startFormData);
            Assert.AreEqual("aStartFormKey", startFormData.FormKey);
        }
Beispiel #8
0
        public virtual void createDeploymentDisabledTenantCheck()
        {
            processEngineConfiguration.SetTenantCheckEnabled(false);
            identityService.SetAuthentication("user", null, null);

            repositoryService.CreateDeployment().AddModelInstance("emptyProcessOne", emptyProcess).TenantId(TENANT_ONE).Deploy();
            repositoryService.CreateDeployment().AddModelInstance("emptyProcessTwo", startEndProcess).TenantId(TENANT_TWO).Deploy();

            IQueryable <IDeployment> query = repositoryService.CreateDeploymentQuery();

            Assert.That(query.Count(), Is.EqualTo(2L));
            Assert.That(query.Where(c => c.TenantId == TENANT_ONE).Count(), Is.EqualTo(1L));
            Assert.That(query.Where(c => c.TenantId == TENANT_TWO).Count(), Is.EqualTo(1L));
        }
Beispiel #9
0
        public virtual void deleteHistoricProcessInstanceWithDisabledTenantCheck()
        {
            testRule.DeployForTenant(TENANT_ONE, BPMN_PROCESS);
            testRule.DeployForTenant(TENANT_TWO, BPMN_PROCESS);

            string processInstanceIdOne = startProcessInstance(TENANT_ONE);
            string processInstanceIdTwo = startProcessInstance(TENANT_TWO);

            identityService.SetAuthentication("user", null, null);
            processEngineConfiguration.SetTenantCheckEnabled(false);

            historyService.DeleteHistoricProcessInstance(processInstanceIdOne);
            historyService.DeleteHistoricProcessInstance(processInstanceIdTwo);

            IQueryable <IHistoricProcessInstance> query = historyService.CreateHistoricProcessInstanceQuery();

            Assert.That(query.Count(), Is.EqualTo(0L));
        }
//JAVA TO C# CONVERTER TODO Resources.Task: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void manuallyStartCaseExecutionDisabledTenantCheck()
        public virtual void manuallyStartCaseExecutionDisabledTenantCheck()
        {
            identityService.SetAuthentication("user", null, null);
            processEngineConfiguration.SetTenantCheckEnabled(false);

            caseService.ManuallyStartCaseExecution(caseExecutionId);

            identityService.ClearAuthentication();

            ICaseExecution caseExecution = CaseExecution;

            Assert.That(caseExecution.Active, Is.EqualTo(true));
        }