use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleEntryTypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleEntryTypedValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
TypedValue typedValue = decisionResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleOutputValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleOutputValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
assertSingleOutputValue(decisionResult.getFirstResult());
assertThat(decisionResult.getSingleEntry()).isEqualTo("singleValue");
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleOutputTypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleOutputTypedValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionResultEntries 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.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleEntryUntypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleEntryUntypedValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
TypedValue typedValue = decisionResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.untypedValue("singleValue"));
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testValueMap.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testValueMap() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(MULTIPLE_OUTPUT_VALUES);
DmnDecisionResultEntries 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");
}
Aggregations