Search in sources :

Example 16 with DefaultMessageProcessorChainBuilder

use of org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder in project mule by mulesoft.

the class ResponseMessageProcessorAdapterTestCase method testResponseAdaptorSingleMPReturnsNull.

@Test
public void testResponseAdaptorSingleMPReturnsNull() throws Exception {
    DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
    final ResponseMessageProcessorAdapter responseMessageProcessorAdapter = new ResponseMessageProcessorAdapter(new ReturnNullMP());
    responseMessageProcessorAdapter.setMuleContext(muleContext);
    builder.chain(createStringAppendTransformer("1"), responseMessageProcessorAdapter, createStringAppendTransformer("2"));
    assertEquals("012", ((PrivilegedEvent) process(builder.build(), eventBuilder(muleContext).message(of("0")).build())).getMessageAsString(muleContext));
}
Also used : DefaultMessageProcessorChainBuilder(org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder) Test(org.junit.Test)

Aggregations

DefaultMessageProcessorChainBuilder (org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder)16 Test (org.junit.Test)5 Processor (org.mule.runtime.core.api.processor.Processor)4 AsyncDelegateMessageProcessor (org.mule.runtime.core.internal.processor.AsyncDelegateMessageProcessor)3 MessageProcessorBuilder (org.mule.runtime.core.privileged.processor.MessageProcessorBuilder)3 Description (io.qameta.allure.Description)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 TimeoutException (java.util.concurrent.TimeoutException)1 NameableObject (org.mule.runtime.api.meta.NameableObject)1 Latch (org.mule.runtime.api.util.concurrent.Latch)1 ReactiveProcessor (org.mule.runtime.core.api.processor.ReactiveProcessor)1 ResponseMessageProcessorAdapter (org.mule.runtime.core.internal.processor.ResponseMessageProcessorAdapter)1 MessageProcessorExpressionPair (org.mule.runtime.core.internal.routing.MessageProcessorExpressionPair)1 MessageProcessorChain (org.mule.runtime.core.privileged.processor.chain.MessageProcessorChain)1 Setup (org.openjdk.jmh.annotations.Setup)1