public void testDynamicPipeline() throws Exception
{
flow.initialise();
flow.start();
MessageProcessor appendPre = new StringAppendTransformer("1");
MessageProcessor appendPost2 = new StringAppendTransformer("4");
String pipelineId = flow.dynamicPipeline(null).injectBefore(appendPre, new StringAppendTransformer("2"))
.injectAfter(new StringAppendTransformer("3"), appendPost2)
.resetAndUpdate();
MuleEvent response = directInboundMessageSource.process(MuleTestUtils.getTestEvent("hello", REQUEST_RESPONSE, muleContext));
assertEquals("hello12abcdef34", response.getMessageAsString());
flow.dynamicPipeline(pipelineId).injectBefore(new StringAppendTransformer("2")).injectAfter(new StringAppendTransformer("3")).resetAndUpdate();
response = directInboundMessageSource.process(MuleTestUtils.getTestEvent("hello", REQUEST_RESPONSE, muleContext));
assertEquals("hello2abcdef3", response.getMessageAsString());
flow.dynamicPipeline(pipelineId).reset();
response = directInboundMessageSource.process(MuleTestUtils.getTestEvent("hello", REQUEST_RESPONSE, muleContext));