use of org.camunda.bpm.dmn.engine.DmnEngine 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.DmnEngine 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());
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class ExpressionLanguageTest method testExecuteJavascriptDmnEngineConfiguration.
@Test
@DecisionResource(resource = SCRIPT_DMN)
public void testExecuteJavascriptDmnEngineConfiguration() {
DmnEngine javascriptEngine = createEngineWithDefaultExpressionLanguage("javascript");
assertExample(javascriptEngine, decision);
verify(scriptEngineResolver, atLeastOnce()).getScriptEngineForLanguage("javascript");
verify(scriptEngineResolver, never()).getScriptEngineForLanguage(JUEL);
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method testFeelInputExpressionWithCustomEngine.
@Test
@DecisionResource(resource = DMN)
public void testFeelInputExpressionWithCustomEngine() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputExpressionExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
// stubbing the default FEEL engine behavior
doReturn(3).when(feelEngineSpy).evaluateSimpleExpression(eq("score"), any(VariableContext.class));
DmnDecisionResult decisionResult = engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
assertThat(decisionResult.getSingleEntry()).isEqualTo("a");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method testFeelOutputEntry.
@Test
@DecisionResource(resource = DMN)
public void testFeelOutputEntry() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultOutputEntryExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
try {
engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
failBecauseExceptionWasNotThrown(UnsupportedOperationException.class);
} catch (UnsupportedOperationException e) {
assertThat(e).hasMessageStartingWith("FEEL-01016");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
}
Aggregations