use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testCollectOutputValues.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testCollectOutputValues() {
DmnDecisionResult 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 DmnDecisionResultTest method testNoOutputValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testNoOutputValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(NO_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
assertNoOutputValue(decisionResult.getFirstResult());
assertThat(decisionResult.getSingleEntry()).isNull();
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleOutputNoName.
@Test
@DecisionResource(resource = RESULT_TEST_WITH_SINGLE_UNNAMED_OUTPUT_DMN)
public void testSingleOutputNoName() {
DmnDecisionResult decisionResult = dmnEngine.evaluateDecision(decision, variables);
assertThat(decisionResult).hasSize(1);
assertThat(decisionResult.getFirstResult()).hasSize(1);
assertThat(decisionResult.getFirstResult().getSingleEntry()).isEqualTo("outputValue");
assertThat(decisionResult.getFirstResult().get(null)).isEqualTo("outputValue");
assertThat(decisionResult.getSingleEntry()).isEqualTo("outputValue");
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testOutputList.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testOutputList() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE, MULTIPLE_OUTPUT_VALUES);
List<Map<String, Object>> entryMapList = decisionResult.getResultList();
assertThat(entryMapList).hasSize(2);
Map<String, Object> firstResult = entryMapList.get(0);
assertThat(firstResult).hasSize(1);
assertThat(firstResult).containsEntry("firstOutput", "singleValue");
Map<String, Object> secondResult = entryMapList.get(1);
assertThat(secondResult).hasSize(2);
assertThat(secondResult).containsEntry("firstOutput", "multipleValues1");
assertThat(secondResult).containsEntry("secondOutput", "multipleValues2");
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testNoResult.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testNoResult() {
DmnDecisionResult results = evaluateWithMatchingRules();
assertThat(results).isEmpty();
assertThat(results.getFirstResult()).isNull();
assertThat(results.getSingleResult()).isNull();
assertThat(results.getSingleEntry()).isNull();
assertThat(results.getSingleEntryTyped()).isNull();
}
Aggregations