RequestContext.setEvent(new DefaultMuleEvent(msg, MuleTestUtils.getTestEvent("previous", muleContext)));
// The transformer we are going to use is ObjectToJMSMessage, which will
// return the same (but mockingly modified!) JMS message that is used as
// input.
ObjectToJMSMessage transformer = createObject(ObjectToJMSMessage.class);
Message transformed = (Message) transformer.transform(msg.getPayload());
// Finally we can assert that the setProperty done to the MuleMessage actually
// made it through to the wrapped JMS Message. Yay!
assertEquals("customValue", transformed.getObjectProperty("JMS_CUSTOM_PROPERTY"));
}