Search in sources :

Example 1 with MockConsumer

use of com.adaptris.interlok.junit.scaffolding.jms.MockConsumer in project interlok by adaptris.

the class OnMessageHandlerTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.openMocks(this);
    mockCorrelationSourceId = new MessageIdCorrelationIdSource();
    mockListener = new MockMessageListener();
    mockListener.setChannel(mockChannel);
    mockTranslator = new TextMessageTranslator();
    config = new MockConsumer();
    config.setCurrentSession(mockSession);
    messageProperties = Collections.emptyEnumeration();
    when(jmsMessage.getPropertyNames()).thenReturn(messageProperties);
    when(jmsMessage.getJMSMessageID()).thenReturn("id");
    when(mockSession.getTransacted()).thenReturn(false);
    when(mockChannel.isAvailable()).thenReturn(true);
    when(mockChannel.getConsumeConnection()).thenReturn(mockConnection);
    when(mockChannel.getProduceConnection()).thenReturn(mockConnection);
}
Also used : MockConsumer(com.adaptris.interlok.junit.scaffolding.jms.MockConsumer) MockMessageListener(com.adaptris.core.stubs.MockMessageListener) Before(org.junit.Before)

Aggregations

MockMessageListener (com.adaptris.core.stubs.MockMessageListener)1 MockConsumer (com.adaptris.interlok.junit.scaffolding.jms.MockConsumer)1 Before (org.junit.Before)1