use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyTaskQueryTest method testQueryNoTenantIdSet.
@Test
public void testQueryNoTenantIdSet() {
TaskQuery query = taskService.createTaskQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyTaskQueryTest method testQueryByTasksWithoutTenantId.
@Test
public void testQueryByTasksWithoutTenantId() {
TaskQuery query = taskService.createTaskQuery().withoutTenantId();
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyTaskQueryTest method testQueryAuthenticatedTenant.
public void testQueryAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
TaskQuery query = taskService.createTaskQuery();
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));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyTaskQueryTest method testQueryAuthenticatedTenants.
public void testQueryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
TaskQuery query = taskService.createTaskQuery();
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));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyTaskQueryTest method testQueryByNonExistingTenantId.
@Test
public void testQueryByNonExistingTenantId() {
TaskQuery query = taskService.createTaskQuery().tenantIdIn(TENANT_NON_EXISTING);
assertThat(query.count(), is(0L));
}
Aggregations