use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyFilterServiceTest method testFilterTasksWithAuthenticatedTenant.
public void testFilterTasksWithAuthenticatedTenant() {
TaskQuery query = taskService.createTaskQuery();
filterId = createFilter(query);
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
assertThat(filterService.count(filterId), is(2L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyFilterServiceTest method testFilterTasksByTenantIds.
public void testFilterTasksByTenantIds() {
TaskQuery query = taskService.createTaskQuery().tenantIdIn(TENANT_IDS);
filterId = createFilter(query);
assertThat(filterService.count(filterId), is(2L));
TaskQuery extendingQuery = taskService.createTaskQuery().taskName("testTask");
assertThat(filterService.count(filterId, extendingQuery), is(2L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyFilterServiceTest method testFilterTasksWithAuthenticatedTenants.
public void testFilterTasksWithAuthenticatedTenants() {
TaskQuery query = taskService.createTaskQuery();
filterId = createFilter(query);
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
assertThat(filterService.count(filterId), is(3L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyMessageCorrelationTest method correlateMessageToStartAndIntermediateCatchEventWithTenantId.
@Test
public void correlateMessageToStartAndIntermediateCatchEventWithTenantId() {
testRule.deployForTenant(TENANT_ONE, MESSAGE_START_PROCESS, MESSAGE_CATCH_PROCESS);
testRule.deployForTenant(TENANT_TWO, MESSAGE_START_PROCESS, MESSAGE_CATCH_PROCESS);
engineRule.getRuntimeService().createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_ONE).execute();
engineRule.getRuntimeService().createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_TWO).execute();
engineRule.getRuntimeService().createMessageCorrelation("message").tenantId(TENANT_ONE).correlateAll();
TaskQuery query = engineRule.getTaskService().createTaskQuery();
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyMessageCorrelationTest method correlateMessageToIntermediateCatchEventWithoutTenantId.
@Test
public void correlateMessageToIntermediateCatchEventWithoutTenantId() {
testRule.deploy(MESSAGE_CATCH_PROCESS);
testRule.deployForTenant(TENANT_ONE, MESSAGE_CATCH_PROCESS);
engineRule.getRuntimeService().createProcessInstanceByKey("messageCatch").processDefinitionWithoutTenantId().execute();
engineRule.getRuntimeService().createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_ONE).execute();
engineRule.getRuntimeService().createMessageCorrelation("message").withoutTenantId().correlate();
TaskQuery query = engineRule.getTaskService().createTaskQuery();
assertThat(query.count(), is(1L));
assertThat(query.singleResult().getTenantId(), is(nullValue()));
}
Aggregations