Search in sources :

Example 6 with MockSkipProducerService

use of com.adaptris.core.stubs.MockSkipProducerService in project interlok by adaptris.

the class RequestReplyWorkflowTest method testWorkflow_SkipProducer_HasNoEffect.

@Test
public void testWorkflow_SkipProducer_HasNoEffect() throws Exception {
    Channel channel = createChannel();
    RequestReplyWorkflow workflow = (RequestReplyWorkflow) channel.getWorkflowList().get(0);
    workflow.getServiceCollection().add(new MockSkipProducerService());
    MockMessageProducer replier = (MockMessageProducer) workflow.getReplyProducer();
    MockRequestReplyProducer requestor = (MockRequestReplyProducer) workflow.getProducer();
    try {
        start(channel);
        submitMessages(workflow, 1);
        doDefaultAssertions(requestor, replier);
        AdaptrisMessage replyMsg = replier.getMessages().get(0);
        assertTrue("Request Metadata", replyMsg.headersContainsKey(REQUEST_METADATA_KEY));
    } finally {
        stop(channel);
    }
}
Also used : MockSkipProducerService(com.adaptris.core.stubs.MockSkipProducerService) MockMessageProducer(com.adaptris.core.stubs.MockMessageProducer) MockChannel(com.adaptris.core.stubs.MockChannel) MockRequestReplyProducer(com.adaptris.core.stubs.MockRequestReplyProducer) Test(org.junit.Test)

Aggregations

MockChannel (com.adaptris.core.stubs.MockChannel)6 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)6 MockSkipProducerService (com.adaptris.core.stubs.MockSkipProducerService)6 Test (org.junit.Test)6 ThrowExceptionService (com.adaptris.core.services.exception.ThrowExceptionService)5 PayloadFromTemplateService (com.adaptris.core.services.metadata.PayloadFromTemplateService)3 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)2 FailFirstMockMessageProducer (com.adaptris.core.stubs.FailFirstMockMessageProducer)2 StaticMockMessageProducer (com.adaptris.core.stubs.StaticMockMessageProducer)2 Channel (com.adaptris.core.Channel)1 Service (com.adaptris.core.Service)1 StandaloneProducer (com.adaptris.core.StandaloneProducer)1 JmsTransactedWorkflow (com.adaptris.core.jms.JmsTransactedWorkflow)1 PtpProducer (com.adaptris.core.jms.PtpProducer)1 WaitService (com.adaptris.core.services.WaitService)1 EventHandlerAwareService (com.adaptris.core.stubs.EventHandlerAwareService)1 MockRequestReplyProducer (com.adaptris.core.stubs.MockRequestReplyProducer)1 XmlRoundTripService (com.adaptris.core.stubs.XmlRoundTripService)1