use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionQueryAuthorizationTest method queryDecisionRequirementsDefinitions.
@Test
@Deployment(resources = { DMN_FILE, ANOTHER_DMN })
public void queryDecisionRequirementsDefinitions() {
// when
authRule.init(scenario).withUser("userId").bindResource("decisionRequirementsDefinitionKey", DEFINITION_KEY).start();
DecisionRequirementsDefinitionQuery query = engineRule.getRepositoryService().createDecisionRequirementsDefinitionQuery();
long count = query.count();
// then
if (authRule.assertScenario(scenario)) {
assertThat(count, is((long) expectedDefinitionKeys.length));
List<String> definitionKeys = getDefinitionKeys(query.list());
assertThat(definitionKeys, hasItems(expectedDefinitionKeys));
}
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class RepositoryServiceTest method testGetDecisionRequirementsModel.
@Deployment(resources = { "org/camunda/bpm/engine/test/repository/drg.dmn" })
public void testGetDecisionRequirementsModel() throws Exception {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery();
DecisionRequirementsDefinition decisionRequirementsDefinition = query.singleResult();
String decisionRequirementsDefinitionId = decisionRequirementsDefinition.getId();
InputStream decisionRequirementsModel = repositoryService.getDecisionRequirementsModel(decisionRequirementsDefinitionId);
assertNotNull(decisionRequirementsModel);
byte[] readInputStream = IoUtil.readInputStream(decisionRequirementsModel, "decisionRequirementsModel");
String model = new String(readInputStream, "UTF-8");
assertTrue(model.contains("<definitions id=\"dish\" name=\"Dish\" namespace=\"test-drg\""));
IoUtil.closeSilently(decisionRequirementsModel);
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class RepositoryServiceTest method testGetDecisionRequirementsDiagram.
@Deployment(resources = { "org/camunda/bpm/engine/test/repository/drg.dmn", "org/camunda/bpm/engine/test/repository/drg.png" })
public void testGetDecisionRequirementsDiagram() throws Exception {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery();
DecisionRequirementsDefinition decisionRequirementsDefinition = query.singleResult();
String decisionRequirementsDefinitionId = decisionRequirementsDefinition.getId();
InputStream actualDrd = repositoryService.getDecisionRequirementsDiagram(decisionRequirementsDefinitionId);
assertNotNull(actualDrd);
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class RepositoryServiceTest method testGetDecisionRequirementsDefinition.
@Deployment(resources = { "org/camunda/bpm/engine/test/repository/drg.dmn" })
public void testGetDecisionRequirementsDefinition() {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery();
DecisionRequirementsDefinition decisionRequirementsDefinition = query.singleResult();
String decisionRequirementsDefinitionId = decisionRequirementsDefinition.getId();
DecisionRequirementsDefinition definition = repositoryService.getDecisionRequirementsDefinition(decisionRequirementsDefinitionId);
assertNotNull(definition);
assertEquals(decisionRequirementsDefinitionId, definition.getId());
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionQueryTest method queryByDecisionRequirementsDefinitionCategoryLike.
@Test
public void queryByDecisionRequirementsDefinitionCategoryLike() {
DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery();
assertThat(query.decisionRequirementsDefinitionCategoryLike("%notExisting%").count(), is(0L));
assertThat(query.decisionRequirementsDefinitionCategoryLike("%test%").count(), is(3L));
assertThat(query.decisionRequirementsDefinitionCategoryLike("%z\\_").count(), is(1L));
}
Aggregations