use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseInstanceQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseInstanceQueryTest method testQueryAuthenticatedTenants.
public void testQueryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
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.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseInstanceQueryTest method testQueryAuthenticatedTenant.
public void testQueryAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
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.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCreateCaseInstanceTest method testCreateCaseInstanceByKeyWithTenantIdAuthenticatedTenant.
public void testCreateCaseInstanceByKeyWithTenantIdAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
deploymentForTenant(TENANT_ONE, CMMN_FILE);
deploymentForTenant(TENANT_TWO, CMMN_FILE);
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).caseDefinitionTenantId(TENANT_ONE).create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
assertThat(query.count(), is(1L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCreateCaseInstanceTest method testCreateCaseInstanceByKeyWithoutTenantIdNoAuthenticatedTenants.
public void testCreateCaseInstanceByKeyWithoutTenantIdNoAuthenticatedTenants() {
identityService.setAuthentication("user", null, null);
deployment(CMMN_FILE);
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).caseDefinitionWithoutTenantId().create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
assertThat(query.count(), is(1L));
}
Aggregations