use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
JobQuery query = managementService.createJobQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobQueryTest method testQueryByNonExistingTenantId.
public void testQueryByNonExistingTenantId() {
JobQuery query = managementService.createJobQuery().tenantIdIn("nonExisting");
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
JobQuery query = managementService.createJobQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobQueryTest method testQueryNoTenantIdSet.
public void testQueryNoTenantIdSet() {
JobQuery query = managementService.createJobQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobQueryTest method testQueryAuthenticatedTenant.
public void testQueryAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
JobQuery query = managementService.createJobQuery();
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).includeJobsWithoutTenantId().count(), is(2L));
}
Aggregations