use of org.kie.dmn.feel.lang.impl.CompilerContextImpl in project drools by kiegroup.
the class FEELParserSeverityTest method parseSeverity.
private ASTNode parseSeverity(String input, FEELEvent.Severity severity) {
FEELEventListenersManager mgr = new FEELEventListenersManager();
CompilerContext ctx = new CompilerContextImpl(mgr);
final FEELEventListener listener = mock(FEELEventListener.class);
mgr.addListener(listener);
mgr.addListener(e -> LOG.info("{}", e));
ProcessedExpression processedExpression = new ProcessedExpression(input, ctx, ProcessedFEELUnit.DefaultMode.Interpreted, Collections.emptyList());
final ArgumentCaptor<FEELEvent> captor = ArgumentCaptor.forClass(FEELEvent.class);
verify(listener, atLeastOnce()).onEvent(captor.capture());
assertThat(captor.getValue().getSeverity(), is(severity));
return processedExpression.getInterpreted().getASTNode();
}
Aggregations