use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionDefinitionQueryTest method testQueryByTenantIdsIncludeDefinitionsWithoutTenantId.
public void testQueryByTenantIdsIncludeDefinitionsWithoutTenantId() {
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery().tenantIdIn(TENANT_ONE).includeDecisionDefinitionsWithoutTenantId();
assertThat(query.count(), is(2L));
query = repositoryService.createDecisionDefinitionQuery().tenantIdIn(TENANT_TWO).includeDecisionDefinitionsWithoutTenantId();
assertThat(query.count(), is(2L));
query = repositoryService.createDecisionDefinitionQuery().tenantIdIn(TENANT_ONE, TENANT_TWO).includeDecisionDefinitionsWithoutTenantId();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class DecisionDefinitionAuthorizationTest method testQueryWithReadPermissionOnAnyDecisionDefinition.
public void testQueryWithReadPermissionOnAnyDecisionDefinition() {
// given user gets read permission on any decision definition
createGrantAuthorization(DECISION_DEFINITION, ANY, userId, READ);
// when
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
// then
verifyQueryResults(query, 2);
}
use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class DecisionDefinitionAuthorizationTest method testQueryWithMultiple.
public void testQueryWithMultiple() {
createGrantAuthorization(DECISION_DEFINITION, DECISION_DEFINITION_KEY, userId, READ);
createGrantAuthorization(DECISION_DEFINITION, ANY, userId, READ);
// when
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
// then
verifyQueryResults(query, 2);
}
use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class DecisionDefinitionQueryTest method queryByInvalidCategory.
@Test
public void queryByInvalidCategory() {
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
query.decisionDefinitionCategory("invalid");
verifyQueryResults(query, 0);
try {
query.decisionDefinitionCategory(null);
fail();
} catch (NotValidException e) {
// Expected exception
}
}
use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class DecisionDefinitionQueryTest method queryByInvalidKeyLike.
@Test
public void queryByInvalidKeyLike() {
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
query.decisionDefinitionKeyLike("%invalid%");
verifyQueryResults(query, 0);
try {
query.decisionDefinitionKeyLike(null);
fail();
} catch (NotValidException e) {
// Expected exception
}
}
Aggregations