use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class ExpressionLanguageTest method testExecuteJuelDmnEngineConfiguration.
@Test
@DecisionResource(resource = SCRIPT_DMN)
public void testExecuteJuelDmnEngineConfiguration() {
DmnEngine juelEngine = createEngineWithDefaultExpressionLanguage(JUEL);
assertExample(juelEngine, decision);
verify(elProvider, atLeastOnce()).createExpression(anyString());
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method testFeelOutputEntryWithCustomEngine.
@Test
@DecisionResource(resource = DMN)
public void testFeelOutputEntryWithCustomEngine() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultOutputEntryExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
// stubbing the default FEEL engine behavior
doReturn("a").when(feelEngineSpy).evaluateSimpleExpression(eq("\"a\""), 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 testFeelInputExpression.
@Test
@DecisionResource(resource = DMN)
public void testFeelInputExpression() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputExpressionExpressionLanguage(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));
}
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class DmnEngineRuleTest method shouldCreateEngineFromCustomConfiguration.
@Test
public void shouldCreateEngineFromCustomConfiguration() {
DmnEngine dmnEngine = customEngineRule.getDmnEngine();
assertThat(dmnEngine).isNotNull();
assertThat(dmnEngine.getConfiguration()).isEqualTo(customConfiguration);
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class DmnEngineRuleTest method shouldCreateDefaultDmnEngineWithNullConfiguration.
@Test
public void shouldCreateDefaultDmnEngineWithNullConfiguration() {
DmnEngine dmnEngine = nullEngineRule.getDmnEngine();
assertThat(dmnEngine).isInstanceOf(DefaultDmnEngine.class).isNotNull();
}
Aggregations