@Test
public void testSpELConditionWithExpressionAndParserContextAndBeanResolver() throws Exception {

    ApplicationContext applicationContext = new AnnotationConfigApplicationContext(MySpringAppConfig.class);
    BeanResolver beanResolver = new SimpleBeanResolver(applicationContext);
    SpELRule spELRule = new SpELRule(beanResolver);
    // setting an condition to be evaluated
    spELRule.when("#{ ['person'].age >= 18 }");
    // provided an bean resolver that can resolve "myGreeter"
    spELRule.then("#{ @myGreeter.greeting(#person.name) }");
    // given
    Facts facts = new Facts();
    facts.put("person", new Person("jack", 19));
    // then
    boolean evaluationResult = spELRule.evaluate(facts);
    Assertions.assertThat(evaluationResult).isTrue();
    spELRule.execute(facts);
    Assertions.assertThat(systemOutRule.getLog()).contains("Bonjour jack!");
}