use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinition 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.DecisionRequirementsDefinition 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.DecisionRequirementsDefinition 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.DecisionRequirementsDefinition in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByDecisionRequirementsDefinitionId.
@Deployment(resources = { DRG_DMN })
public void testQueryByDecisionRequirementsDefinitionId() {
decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue("temperature", 21).putValue("dayType", "Weekend")).evaluate();
DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.decisionRequirementsDefinitionId("notExisting").count(), is(0L));
assertThat(query.decisionRequirementsDefinitionId(decisionRequirementsDefinition.getId()).count(), is(3L));
}
use of org.camunda.bpm.engine.repository.DecisionRequirementsDefinition in project camunda-bpm-platform by camunda.
the class MockDecisionRequirementsDefinitionBuilder method build.
public DecisionRequirementsDefinition build() {
DecisionRequirementsDefinition mockDefinition = mock(DecisionRequirementsDefinition.class);
when(mockDefinition.getId()).thenReturn(id);
when(mockDefinition.getCategory()).thenReturn(category);
when(mockDefinition.getName()).thenReturn(name);
when(mockDefinition.getKey()).thenReturn(key);
when(mockDefinition.getVersion()).thenReturn(version);
when(mockDefinition.getResourceName()).thenReturn(resource);
when(mockDefinition.getDiagramResourceName()).thenReturn(diagramResource);
when(mockDefinition.getDeploymentId()).thenReturn(deploymentId);
when(mockDefinition.getTenantId()).thenReturn(tenantId);
return mockDefinition;
}
Aggregations