@Test
public void testMVELActionWithExpressionAndParserContext() throws Exception {

    // given
    ParserContext context = new ParserContext();
    context.addPackageImport("java.util");
    Action printAction = new MVELAction("def random() { System.out.println(\"Random from MVEL = \" + new java.util.Random(123).nextInt(10)); }; random();", context);
    Facts facts = new Facts();
    // when
    printAction.execute(facts);
    // then
    assertThat(systemOutRule.getLog()).contains("Random from MVEL = 2");
}