@Test
public void testCompiledScriptCaching() throws ScriptException {
// given
DmnExpressionImpl expression = createExpression("1 > 2", "groovy");
// when
expressionEvaluationHandler.evaluateExpression("groovy", expression, emptyVariableContext());
// then
InOrder inOrder = inOrder(expression, scriptEngineSpy);
inOrder.verify(expression, atLeastOnce()).getCachedCompiledScript();
inOrder.verify(compilableSpy, times(1)).compile(anyString());
inOrder.verify(expression, times(1)).cacheCompiledScript(any(CompiledScript.class));
// when (2)
expressionEvaluationHandler.evaluateExpression("groovy", expression, emptyVariableContext());
// then (2)
inOrder.verify(expression, atLeastOnce()).getCachedCompiledScript();
inOrder.verify(compilableSpy, times(0)).compile(anyString());
}
ExpressionCachingTest.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:camunda-engine-dmn
作者:
评论列表
文章目录