}
@Test
public void testNullPayloadIsConsideredAsNullResultEL() throws Exception
{
ExpressionTransformer transformer = new ExpressionTransformer();
transformer.setMuleContext(muleContext);
transformer.setReturnSourceIfNull(true);
ExpressionConfig config = new ExpressionConfig("null", null, null);
// MVL doesn't return NullPayload but rather null. So 'optional' needs to be true.
ExpressionArgument argument = new ExpressionArgument("test", config, true);
argument.setMuleContext(muleContext);
transformer.addArgument(argument);
MuleMessage message = new DefaultMuleMessage("Test", muleContext);
Object result = transformer.transformMessage(message, null);
assertTrue(result instanceof MuleMessage);
MuleMessage transformedMessage = (MuleMessage) result;
assertEquals("Test", transformedMessage.getPayload());