use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionQueryTest method testQueryByLatestWithTenantIds.
public void testQueryByLatestWithTenantIds() {
// deploy a second version for tenant one
deploymentForTenant(TENANT_ONE, CMMN);
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery().caseDefinitionKey(CASE_DEFINITION_KEY).latestVersion().tenantIdIn(TENANT_ONE, TENANT_TWO);
// one definition for each tenant
assertThat(query.count(), is(2L));
Map<String, CaseDefinition> caseDefinitionsForTenant = getCaseDefinitionsForTenant(query.list());
assertThat(caseDefinitionsForTenant.get(TENANT_ONE).getVersion(), is(2));
assertThat(caseDefinitionsForTenant.get(TENANT_TWO).getVersion(), is(1));
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionQueryTest method testQueryByLatestWithTenantIdsIncludeDefinitionsWithoutTenantId.
public void testQueryByLatestWithTenantIdsIncludeDefinitionsWithoutTenantId() {
// deploy a second version without tenant id
deployment(CMMN);
// deploy a third version for tenant one
deploymentForTenant(TENANT_ONE, CMMN);
deploymentForTenant(TENANT_ONE, CMMN);
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery().caseDefinitionKey(CASE_DEFINITION_KEY).latestVersion().tenantIdIn(TENANT_ONE, TENANT_TWO).includeCaseDefinitionsWithoutTenantId();
assertThat(query.count(), is(3L));
Map<String, CaseDefinition> caseDefinitionsForTenant = getCaseDefinitionsForTenant(query.list());
assertThat(caseDefinitionsForTenant.get(TENANT_ONE).getVersion(), is(3));
assertThat(caseDefinitionsForTenant.get(TENANT_TWO).getVersion(), is(1));
assertThat(caseDefinitionsForTenant.get(null).getVersion(), is(2));
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionQueryTest method testQueryByKey.
public void testQueryByKey() {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery().caseDefinitionKey(CASE_DEFINITION_KEY);
// one definition for each tenant
assertThat(query.count(), is(3L));
query = repositoryService.createCaseDefinitionQuery().caseDefinitionKey(CASE_DEFINITION_KEY).withoutTenantId();
// one definition without tenant id
assertThat(query.count(), is(1L));
query = repositoryService.createCaseDefinitionQuery().caseDefinitionKey(CASE_DEFINITION_KEY).tenantIdIn(TENANT_ONE);
// one definition for tenant one
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionQueryTest method testQueryByDefinitionsWithoutTenantId.
public void testQueryByDefinitionsWithoutTenantId() {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery().withoutTenantId();
assertThat(query.count(), is(1L));
}
Aggregations