예제 #1
0
        public virtual void testQueryByTenantId()
        {
            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery().tenantIdIn(TENANT_ONE);

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

            query = externalTaskService.createExternalTaskQuery().tenantIdIn(TENANT_TWO);

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

            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();

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

            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();

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

            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
        }
예제 #5
0
        private ExternalTaskQuery setUpMockExternalTaskQuery(IList <ExternalTask> mockedTasks)
        {
            ExternalTaskQuery sampleTaskQuery = mock(typeof(ExternalTaskQuery));

            when(sampleTaskQuery.list()).thenReturn(mockedTasks);
            when(sampleTaskQuery.count()).thenReturn((long)mockedTasks.Count);

            when(processEngine.ExternalTaskService.createExternalTaskQuery()).thenReturn(sampleTaskQuery);

            return(sampleTaskQuery);
        }
예제 #6
0
        public virtual CountResultDto queryExternalTasksCount(ExternalTaskQueryDto queryDto)
        {
            ProcessEngine engine = ProcessEngine;

            queryDto.ObjectMapper = ObjectMapper;
            ExternalTaskQuery query = queryDto.toQuery(engine);

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

            result.Count = count;

            return(result);
        }
예제 #7
0
        public virtual void testQueryByNonExistingTenantId()
        {
            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery().tenantIdIn("nonExisting");

            assertThat(query.count(), @is(0L));
        }
예제 #8
0
        public virtual void testQueryWithoutTenantId()
        {
            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();

            assertThat(query.count(), @is(2L));
        }
예제 #9
0
        public virtual void testQueryByNonExistingProcessInstanceId()
        {
            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery().processInstanceIdIn("nonExisting");

            assertEquals(0, query.count());
        }