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)); }
public virtual void testQueryNoAuthenticatedTenants() { identityService.setAuthentication("user", null, null); ExternalTaskQuery query = externalTaskService.createExternalTaskQuery(); assertThat(query.count(), @is(0L)); }
public virtual void testQueryDisabledTenantCheck() { processEngineConfiguration.TenantCheckEnabled = false; identityService.setAuthentication("user", null, null); ExternalTaskQuery query = externalTaskService.createExternalTaskQuery(); assertThat(query.count(), @is(2L)); }
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)); }
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); }
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); }
public virtual void testQueryByNonExistingTenantId() { ExternalTaskQuery query = externalTaskService.createExternalTaskQuery().tenantIdIn("nonExisting"); assertThat(query.count(), @is(0L)); }
public virtual void testQueryWithoutTenantId() { ExternalTaskQuery query = externalTaskService.createExternalTaskQuery(); assertThat(query.count(), @is(2L)); }
public virtual void testQueryByNonExistingProcessInstanceId() { ExternalTaskQuery query = externalTaskService.createExternalTaskQuery().processInstanceIdIn("nonExisting"); assertEquals(0, query.count()); }