use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnEngineApiTest method shouldEvaluateDecisionLiteralExpression.
@Test
@DecisionResource(resource = DECISION_LITERAL_EXPRESSION_DMN)
public void shouldEvaluateDecisionLiteralExpression() {
DmnDecisionResult results = dmnEngine.evaluateDecision(decision, createVariables().putValue("input", INPUT_VALUE));
assertThat(results.getSingleEntry()).isNotNull().isEqualTo(EXPECTED_OUTPUT_VALUE);
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnEngineApiTest method shouldEvaluateDecisionWithVariableMap.
@Test
@DecisionResource(resource = ONE_RULE_DMN)
public void shouldEvaluateDecisionWithVariableMap() {
DmnDecisionResult results = dmnEngine.evaluateDecision(decision, createVariables().putValue("input", INPUT_VALUE));
assertThat(results.getSingleEntry()).isNotNull().isEqualTo(EXPECTED_OUTPUT_VALUE);
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnEngineMetricCollectorTest method testExecutedDecisionElementsOfDrg.
@Test
@DecisionResource(resource = DISH_EXAMPLE_DMN, decisionKey = "Dish")
public void testExecutedDecisionElementsOfDrg() {
assertThat(metricCollector.getExecutedDecisionElements()).isEqualTo(0L);
VariableMap variableMap = createVariables().putValue("temperature", 20).putValue("dayType", "Weekend");
dmnEngine.evaluateDecisionTable(decision, variableMap);
assertThat(metricCollector.getExecutedDecisionElements()).isEqualTo(30L);
dmnEngine.evaluateDecisionTable(decision, variableMap);
assertThat(metricCollector.getExecutedDecisionElements()).isEqualTo(60L);
dmnEngine.evaluateDecisionTable(decision, variableMap);
dmnEngine.evaluateDecisionTable(decision, variableMap);
assertThat(metricCollector.getExecutedDecisionElements()).isEqualTo(120L);
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class ExpressionEvaluationTest method testHasInputVariableNameInVariableContext.
@Test
@DecisionResource(resource = DMN_VARIABLE_CONTEXT_WITH_INPUT_VARIABLE)
public void testHasInputVariableNameInVariableContext() {
DmnDecisionResult decisionResult = dmnEngine.evaluateDecision(decision, Variables.createVariables().putValue("in", 3));
assertThat(decisionResult.getSingleEntry()).isEqualTo(true);
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class ExpressionEvaluationTest method testHasInputVariableName.
@Test
@DecisionResource(resource = DMN_INPUT_VARIABLE)
public void testHasInputVariableName() {
DmnDecisionResult decisionResult = dmnEngine.evaluateDecision(decision, Variables.createVariables().putValue("in", 2));
assertThat(decisionResult.getSingleEntry()).isEqualTo(true);
}
Aggregations