use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testSingleOutputValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleOutputValue() {
DmnDecisionTableResult 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 DmnDecisionTableResultTest method testSingleResult.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleResult() {
DmnDecisionTableResult results = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(results).hasSize(1);
assertSingleOutputValue(results.get(0));
assertSingleOutputValue(results.getFirstResult());
assertSingleOutputValue(results.getSingleResult());
assertThat(results.getSingleEntry()).isEqualTo("singleValue");
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testCollectOutputValues.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testCollectOutputValues() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(NO_OUTPUT_VALUE, SINGLE_OUTPUT_VALUE, MULTIPLE_OUTPUT_VALUES);
assertThat(decisionResult).hasSize(3);
List<String> entryValues = decisionResult.collectEntries("firstOutput");
assertThat(entryValues).containsExactly("singleValue", "multipleValues1");
entryValues = decisionResult.collectEntries("secondOutput");
assertThat(entryValues).containsExactly("multipleValues2");
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource 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.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testNoResult.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testNoResult() {
DmnDecisionTableResult results = evaluateWithMatchingRules();
assertThat(results).isEmpty();
assertThat(results.getFirstResult()).isNull();
assertThat(results.getSingleResult()).isNull();
assertThat(results.getSingleEntry()).isNull();
assertThat(results.getSingleEntryTyped()).isNull();
}
Aggregations