use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByNonExistingTenantId.
@Test
public void queryByNonExistingTenantId() {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn("nonExisting");
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryDisabledTenantCheck.
@Test
public void queryDisabledTenantCheck() {
engineRule.getProcessEngineConfiguration().setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByLatestWithTenantId.
@Test
public void queryByLatestWithTenantId() {
// deploy a second version for tenant one
testRule.deployForTenant(TENANT_ONE, DMN);
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY).latestVersion().tenantIdIn(TENANT_ONE);
assertThat(query.count(), is(1L));
DecisionRequirementsDefinition DecisionRequirementsDefinition = query.singleResult();
assertThat(DecisionRequirementsDefinition.getTenantId(), is(TENANT_ONE));
assertThat(DecisionRequirementsDefinition.getVersion(), is(2));
query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY).latestVersion().tenantIdIn(TENANT_TWO);
assertThat(query.count(), is(1L));
DecisionRequirementsDefinition = query.singleResult();
assertThat(DecisionRequirementsDefinition.getTenantId(), is(TENANT_TWO));
assertThat(DecisionRequirementsDefinition.getVersion(), is(1));
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryAuthenticatedTenants.
@Test
public void queryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery();
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.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByKey.
@Test
public void queryByKey() {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY);
// one definition for each tenant
assertThat(query.count(), is(3L));
query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY).withoutTenantId();
// one definition without tenant id
assertThat(query.count(), is(1L));
query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY).tenantIdIn(TENANT_ONE);
// one definition for tenant one
assertThat(query.count(), is(1L));
}
Aggregations