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")));
}
Aggregations