use of org.springframework.data.redis.connection.MessageListener in project camel by apache.
the class RedisConsumerTest method consumerReceivesMessages.
@Test
public void consumerReceivesMessages() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(2);
ArgumentCaptor<MessageListener> messageListenerCaptor = ArgumentCaptor.forClass(MessageListener.class);
verify(listenerContainer).addMessageListener(messageListenerCaptor.capture(), any(Collection.class));
MessageListener messageListener = messageListenerCaptor.getValue();
messageListener.onMessage(new DefaultMessage(null, null), null);
messageListener.onMessage(new DefaultMessage(null, null), null);
mock.assertIsSatisfied();
}
Aggregations