use of com.adaptris.interlok.junit.scaffolding.jms.MockProducer in project interlok by adaptris.
the class OnMessageHandlerTest method testOnMessageHandlerProducerFailsRollback.
@Test
public void testOnMessageHandlerProducerFailsRollback() throws Exception {
when(mockSession.getTransacted()).thenReturn(true);
JmsTransactedWorkflow jmsTransactedWorkflow = new JmsTransactedWorkflow();
jmsTransactedWorkflow.setConsumer(new NullMessageConsumer());
jmsTransactedWorkflow.setProducer(new MockProducer());
jmsTransactedWorkflow.setStrict(true);
jmsTransactedWorkflow.registerChannel(mockChannel);
config.setCorrelationIdSource(mockCorrelationSourceId);
config.setMessageTranslator(mockTranslator);
config.registerAdaptrisMessageListener(jmsTransactedWorkflow);
handler = new OnMessageHandler(config);
handler.onMessage(jmsMessage);
verify(mockSession).rollback();
}
Aggregations