use of org.camunda.bpm.dmn.engine.DmnDecisionRuleResult in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultAssert method hasSingleResult.
public DmnDecisionRuleResultAssert hasSingleResult() {
hasSize(1);
DmnDecisionRuleResult singleResult = actual.getSingleResult();
return new DmnDecisionRuleResultAssert(singleResult);
}
use of org.camunda.bpm.dmn.engine.DmnDecisionRuleResult in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testSingleOutputTypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleOutputTypedValue() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();
TypedValue typedValue = ruleResult.getEntryTyped("firstOutput");
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
typedValue = ruleResult.getEntryTyped("secondOutput");
assertThat(typedValue).isNull();
typedValue = ruleResult.getFirstEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
typedValue = ruleResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
}
use of org.camunda.bpm.dmn.engine.DmnDecisionRuleResult in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testSingleOutputUntypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleOutputUntypedValue() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();
TypedValue typedEntry = ruleResult.getEntryTyped("firstOutput");
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
typedEntry = ruleResult.getEntryTyped("secondOutput");
assertThat(typedEntry).isNull();
typedEntry = ruleResult.getFirstEntryTyped();
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
typedEntry = ruleResult.getSingleEntryTyped();
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
}
use of org.camunda.bpm.dmn.engine.DmnDecisionRuleResult in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testValueMap.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testValueMap() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(MULTIPLE_OUTPUT_VALUES);
DmnDecisionRuleResult ruleResult = decisionResult.getSingleResult();
assertThat(ruleResult).hasSize(2);
Map<String, Object> entryMap = ruleResult.getEntryMap();
assertThat(entryMap).hasSize(2);
assertThat(entryMap).containsEntry("firstOutput", "multipleValues1");
assertThat(entryMap).containsEntry("secondOutput", "multipleValues2");
}
use of org.camunda.bpm.dmn.engine.DmnDecisionRuleResult in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultImpl method getResultList.
@Override
public List<Map<String, Object>> getResultList() {
List<Map<String, Object>> entryMapList = new ArrayList<Map<String, Object>>();
for (DmnDecisionRuleResult ruleResult : ruleResults) {
Map<String, Object> entryMap = ruleResult.getEntryMap();
entryMapList.add(entryMap);
}
return entryMapList;
}
Aggregations