Search in sources :

Example 11 with SenderWrapperBase

use of nl.nn.adapterframework.senders.SenderWrapperBase in project iaf by ibissource.

the class InputOutputSenderWrapperProcessorTest method testInputOutputSenderWrapperProcessor.

public void testInputOutputSenderWrapperProcessor(SenderWrapperBase sender, String input, String expectedSecondSenderOutput, String expectedWrapperOutput, String expectedSessionKeyValue) throws Exception {
    InputOutputSenderWrapperProcessor processor = new InputOutputSenderWrapperProcessor();
    SenderWrapperProcessor target = new SenderWrapperProcessor() {

        @Override
        public Message sendMessage(SenderWrapperBase senderWrapperBase, Message message, PipeLineSession session) throws SenderException, TimeoutException {
            return senderWrapperBase.sendMessage(message, session);
        }
    };
    processor.setSenderWrapperProcessor(target);
    Message actual = processor.sendMessage(sender, new Message(input), session);
    assertEquals("unexpected output of last sender", expectedSecondSenderOutput, secondSenderOutput);
    assertEquals("unexpected wrapper output", expectedWrapperOutput, actual.asString());
    assertEquals("unexpected session variable value", expectedSessionKeyValue, Message.asString(session.get("storedResult")));
}
Also used : SenderWrapperBase(nl.nn.adapterframework.senders.SenderWrapperBase) Message(nl.nn.adapterframework.stream.Message) PipeLineSession(nl.nn.adapterframework.core.PipeLineSession)

Aggregations

SenderWrapperBase (nl.nn.adapterframework.senders.SenderWrapperBase)11 Test (org.junit.Test)9 INamedObject (nl.nn.adapterframework.core.INamedObject)1 ISender (nl.nn.adapterframework.core.ISender)1 IWithParameters (nl.nn.adapterframework.core.IWithParameters)1 PipeLineSession (nl.nn.adapterframework.core.PipeLineSession)1 PipeRunResult (nl.nn.adapterframework.core.PipeRunResult)1 JmsSender (nl.nn.adapterframework.jms.JmsSender)1 ParameterList (nl.nn.adapterframework.parameters.ParameterList)1 Message (nl.nn.adapterframework.stream.Message)1