コード例 #1
0
        public virtual void testQueryByTenantId()
        {
            HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().tenantIdIn(TENANT_ONE);

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

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

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

            HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();

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

            HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();

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

            HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();

            assertThat(query.count(), @is(4L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(2L));
        }
コード例 #5
0
        protected internal virtual HistoricJobLogQuery setUpMockHistoricJobLogQuery(IList <HistoricJobLog> mockedHistoricJogLogs)
        {
            HistoricJobLogQuery mockedhistoricJobLogQuery = mock(typeof(HistoricJobLogQuery));

            when(mockedhistoricJobLogQuery.list()).thenReturn(mockedHistoricJogLogs);
            when(mockedhistoricJobLogQuery.count()).thenReturn((long)mockedHistoricJogLogs.Count);

            when(processEngine.HistoryService.createHistoricJobLogQuery()).thenReturn(mockedhistoricJobLogQuery);

            return(mockedhistoricJobLogQuery);
        }
コード例 #6
0
        public virtual CountResultDto queryHistoricJobLogsCount(HistoricJobLogQueryDto queryDto)
        {
            queryDto.ObjectMapper = objectMapper;
            HistoricJobLogQuery query = queryDto.toQuery(processEngine);

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

            result.Count = count;

            return(result);
        }
コード例 #7
0
        protected internal virtual void verifyQueryResults(HistoricJobLogQuery query, int countExpected)
        {
            assertEquals(countExpected, query.list().size());
            assertEquals(countExpected, query.count());

            if (countExpected == 1)
            {
                assertNotNull(query.singleResult());
            }
            else if (countExpected > 1)
            {
                verifySingleResultFails(query);
            }
            else if (countExpected == 0)
            {
                assertNull(query.singleResult());
            }
        }
コード例 #8
0
        public virtual void testQueryByNonExistingTenantId()
        {
            HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().tenantIdIn("nonExisting");

            assertThat(query.count(), @is(0L));
        }
コード例 #9
0
        public virtual void testQueryWithoutTenantId()
        {
            HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();

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