private static String MULE_CORRELATION_ID_VAL = "152";
public void testProcess() throws Exception
{
OutboundEndpoint endpoint = createTestOutboundEndpoint(null, null);
InterceptingMessageProcessor mp = new OutboundResponsePropertiesMessageProcessor(endpoint);
mp.setListener(new MessageProcessor()
{
public MuleEvent process(MuleEvent event) throws MuleException
{
// return event with same payload but no properties
return new DefaultMuleEvent(new DefaultMuleMessage(event.getMessage().getPayload(),
muleContext), MessageExchangePattern.REQUEST_RESPONSE, null);
}
});
MuleEvent event = createTestOutboundEvent();
event.getMessage().setOutboundProperty(MY_PROPERTY_KEY, MY_PROPERTY_VAL);
event.getMessage().setOutboundProperty(MuleProperties.MULE_CORRELATION_ID_PROPERTY, MULE_CORRELATION_ID_VAL);
MuleEvent result = mp.process(event);
assertNotNull(result);
assertEquals(TEST_MESSAGE, result.getMessageAsString());
assertEquals(MY_PROPERTY_VAL, result.getMessage().getOutboundProperty(MY_PROPERTY_KEY));
assertEquals(MULE_CORRELATION_ID_VAL,