Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public virtual void testQueryNoAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, null);

            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();

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

            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();

            assertThat(query.count(), @is(2L));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 7
0
        public virtual void testQueryByNonExistingTenantId()
        {
            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery().tenantIdIn("nonExisting");

            assertThat(query.count(), @is(0L));
        }
Exemplo n.º 8
0
        public virtual void testQueryWithoutTenantId()
        {
            ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();

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

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