assertEquals("", result.getPayload());
}
public void testEnrichHeadersMToN() throws Exception
{
MessageEnricher enricher = new MessageEnricher();
enricher.addEnrichExpressionPair(new EnrichExpressionPair("#[header:header1]", "#[header:myHeader1]"));
enricher.addEnrichExpressionPair(new EnrichExpressionPair("#[header:header2]", "#[header:myHeader2]"));
enricher.addEnrichExpressionPair(new EnrichExpressionPair("#[header:header3]", "#[header:myHeader3]"));
enricher.setEnrichmentMessageProcessor(new MessageProcessor()
{
public MuleEvent process(MuleEvent event) throws MuleException
{
event.getMessage().setOutboundProperty("header1", "test");
event.getMessage().setOutboundProperty("header2", "test2");
event.getMessage().setOutboundProperty("header3", "test3");
return event;
}
});
MuleMessage result = enricher.process(getTestEvent("")).getMessage();
assertNull(result.getOutboundProperty("myHeader"));
assertEquals("test2",result.getOutboundProperty("myHeader2"));
assertEquals("test3",result.getOutboundProperty("myHeader3"));