use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByTenantId.
@Test
public void queryByTenantId() {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE);
assertThat(query.count(), is(1L));
query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_TWO);
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByDefinitionsWithoutTenantId.
@Test
public void queryByDefinitionsWithoutTenantId() {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().withoutTenantId();
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByLatestWithoutTenantId.
@Test
public void queryByLatestWithoutTenantId() {
// deploy a second version without tenant id
testRule.deploy(DMN);
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY).latestVersion().withoutTenantId();
assertThat(query.count(), is(1L));
DecisionRequirementsDefinition DecisionRequirementsDefinition = query.singleResult();
assertThat(DecisionRequirementsDefinition.getTenantId(), is(nullValue()));
assertThat(DecisionRequirementsDefinition.getVersion(), is(2));
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByTenantIdsIncludeDefinitionsWithoutTenantId.
@Test
public void queryByTenantIdsIncludeDefinitionsWithoutTenantId() {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE).includeDecisionRequirementsDefinitionsWithoutTenantId();
assertThat(query.count(), is(2L));
query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_TWO).includeDecisionRequirementsDefinitionsWithoutTenantId();
assertThat(query.count(), is(2L));
query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE, TENANT_TWO).includeDecisionRequirementsDefinitionsWithoutTenantId();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByLatestWithTenantIdsIncludeDefinitionsWithoutTenantId.
@Test
public void queryByLatestWithTenantIdsIncludeDefinitionsWithoutTenantId() {
// deploy a second version without tenant id
testRule.deploy(DMN);
// deploy a third version for tenant one
testRule.deployForTenant(TENANT_ONE, DMN);
testRule.deployForTenant(TENANT_ONE, DMN);
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY).latestVersion().tenantIdIn(TENANT_ONE, TENANT_TWO).includeDecisionRequirementsDefinitionsWithoutTenantId();
assertThat(query.count(), is(3L));
Map<String, DecisionRequirementsDefinition> definitionsForTenant = getDecisionRequirementsDefinitionsForTenant(query.list());
assertThat(definitionsForTenant.get(TENANT_ONE).getVersion(), is(3));
assertThat(definitionsForTenant.get(TENANT_TWO).getVersion(), is(1));
assertThat(definitionsForTenant.get(null).getVersion(), is(2));
}
Aggregations