Search in sources :

Example 31 with DecisionDefinitionQuery

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));
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery)

Example 32 with DecisionDefinitionQuery

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);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery)

Example 33 with DecisionDefinitionQuery

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);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery)

Example 34 with DecisionDefinitionQuery

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
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Example 35 with DecisionDefinitionQuery

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
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Aggregations

DecisionDefinitionQuery (org.camunda.bpm.engine.repository.DecisionDefinitionQuery)49 Test (org.junit.Test)23 NotValidException (org.camunda.bpm.engine.exception.NotValidException)10 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)10 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 DecisionDefinitionQueryDto (org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionQueryDto)2 Deployment (org.camunda.bpm.engine.test.Deployment)2 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 DecisionRequirementsDefinition (org.camunda.bpm.engine.repository.DecisionRequirementsDefinition)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 DecisionDefinitionDto (org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionDto)1