MVELExpressionEvaluator extends ExpressionEvaluator { public String evaluate(Object information) { Object result=MVEL.executeExpression(_compiledExpression, information, new java.util.HashMap<String,Object>()); if (result != null) { return (result.toString()); } return (null); }  @Override void init(); String evaluate(Object information);  }
@Test public void testEvaluate() { MVELExpressionEvaluator evaluator=new MVELExpressionEvaluator(); RequestReceived rr=new RequestReceived(); rr.setMessageId(TEST_MESSAGE_ID); evaluator.setExpression("messageId"); try { evaluator.init(); } catch (Exception e) { fail("Evaluator should have initialized: "+e); } String result=evaluator.evaluate(rr); if (result == null) { fail("Result is null"); } if (!result.equals(TEST_MESSAGE_ID)) { fail("Unexpected result: "+result); } }