Exemple #1
0
        public virtual void testQueryByTenantId()
        {
            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().tenantIdIn(TENANT_ONE);

            assertThat(query.count(), @is(1L));

            query = historyService.createHistoricProcessInstanceQuery().tenantIdIn(TENANT_TWO);

            assertThat(query.count(), @is(1L));
        }
Exemple #2
0
        public virtual void testQueryNoAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, null);

            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();

            assertThat(query.count(), @is(1L));
        }
Exemple #3
0
        public virtual void testQueryDisabledTenantCheck()
        {
            processEngineConfiguration.TenantCheckEnabled = false;
            identityService.setAuthentication("user", null, null);

            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();

            assertThat(query.count(), @is(3L));
        }
Exemple #4
0
        public virtual void testQueryAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));

            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();

            assertThat(query.count(), @is(3L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
            assertThat(query.withoutTenantId().count(), @is(1L));
        }
Exemple #5
0
        public virtual void testQueryAuthenticatedTenant()
        {
            identityService.setAuthentication("user", null, Collections.singletonList(TENANT_ONE));

            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
            assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).count(), @is(1L));
        }
Exemple #6
0
        public virtual CountResultDto queryHistoricProcessInstancesCount(HistoricProcessInstanceQueryDto queryDto)
        {
            queryDto.ObjectMapper = objectMapper;
            HistoricProcessInstanceQuery query = queryDto.toQuery(processEngine);

            long           count  = query.count();
            CountResultDto result = new CountResultDto();

            result.Count = count;

            return(result);
        }
Exemple #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void deleteHistoricProcessInstanceWithAuthenticatedTenant()
        public virtual void deleteHistoricProcessInstanceWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, BPMN_PROCESS);
            string processInstanceId = startProcessInstance(null);

            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            historyService.deleteHistoricProcessInstance(processInstanceId);

            identityService.clearAuthentication();

            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();

            assertThat(query.count(), @is(0L));
        }
Exemple #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void deleteHistoricProcessInstanceWithDisabledTenantCheck()
        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.TenantCheckEnabled = false;

            historyService.deleteHistoricProcessInstance(processInstanceIdOne);
            historyService.deleteHistoricProcessInstance(processInstanceIdTwo);

            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();

            assertThat(query.count(), @is(0L));
        }
Exemple #9
0
        protected internal virtual void cleanUpAfterVariableInstanceTest(params string[] processInstanceIds)
        {
            processEngineConfiguration.TenantCheckEnabled = false;
            foreach (string processInstanceId in processInstanceIds)
            {
                Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
                if (task != null)
                {
                    taskService.complete(task.Id);
                }
                historyService.deleteHistoricProcessInstance(processInstanceId);
            }

            identityService.clearAuthentication();

            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();

            assertThat(query.count(), @is(0L));
            processEngineConfiguration.TenantCheckEnabled = true;
        }
Exemple #10
0
        public virtual void testQueryByWithoutTenantId()
        {
            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().withoutTenantId();

            assertThat(query.count(), @is(1L));
        }
Exemple #11
0
        public virtual void testQueryByNonExistingTenantId()
        {
            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().tenantIdIn("nonExisting");

            assertThat(query.count(), @is(0L));
        }
Exemple #12
0
        public virtual void testQueryNoTenantIdSet()
        {
            HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();

            assertThat(query.count(), @is(3L));
        }