use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class DmnEngineApiTest method shouldEvaluateDecisionWithVariableContext.
@Test
@DecisionResource(resource = ONE_RULE_DMN)
public void shouldEvaluateDecisionWithVariableContext() {
DmnDecisionResult results = dmnEngine.evaluateDecision(decision, createVariables().putValue("input", INPUT_VALUE).asVariableContext());
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 ExpressionEvaluationTest method testHasVariableContext.
@Test
@DecisionResource(resource = DMN_VARIABLE_CONTEXT)
public void testHasVariableContext() {
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 ExpressionLanguageTest method testExecuteGroovyDmnEngineConfiguration.
@Test
@DecisionResource(resource = SCRIPT_DMN)
public void testExecuteGroovyDmnEngineConfiguration() {
DmnEngine groovyEngine = createEngineWithDefaultExpressionLanguage("groovy");
assertExample(groovyEngine, decision);
verify(scriptEngineResolver, atLeastOnce()).getScriptEngineForLanguage("groovy");
verify(scriptEngineResolver, never()).getScriptEngineForLanguage(JUEL);
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class ExpressionLanguageTest method testGlobalExpressionLanguageDecisionTable.
@Test
@DecisionResource(resource = GROOVY_DECISION_TABLE_DMN)
public void testGlobalExpressionLanguageDecisionTable() {
DmnDecisionTableImpl decisionTable = (DmnDecisionTableImpl) decision.getDecisionLogic();
for (DmnDecisionTableInputImpl dmnInput : decisionTable.getInputs()) {
assertThat(dmnInput.getExpression().getExpressionLanguage()).isEqualTo("groovy");
}
for (DmnDecisionTableRuleImpl dmnRule : decisionTable.getRules()) {
for (DmnExpressionImpl condition : dmnRule.getConditions()) {
assertThat(condition.getExpressionLanguage()).isEqualTo("groovy");
}
for (DmnExpressionImpl conclusion : dmnRule.getConclusions()) {
assertThat(conclusion.getExpressionLanguage()).isEqualTo("groovy");
}
}
assertExample(dmnEngine, decision);
verify(scriptEngineResolver, atLeastOnce()).getScriptEngineForLanguage("groovy");
verify(scriptEngineResolver, never()).getScriptEngineForLanguage(JUEL);
}
use of org.camunda.bpm.dmn.engine.test.DecisionResource in project camunda-engine-dmn by camunda.
the class ExpressionLanguageTest method testElResolution.
@Test
@DecisionResource(resource = CAPITAL_JUEL_DMN)
public void testElResolution() throws Exception {
DmnEngine juelEngine = createEngineWithDefaultExpressionLanguage(JUEL);
assertExample(juelEngine, decision);
verify(elProvider, atLeastOnce()).createExpression(anyString());
verify(scriptEngineResolver, never()).getScriptEngineForLanguage(JUEL.toUpperCase());
}
Aggregations