Assert.assertEquals(1, messages.size());
}
@Test
public void testListWithTypeAndDirectionCriteria() throws Exception {
MessageHandler handler = mock(MessageHandler.class);
when(handler.supportsDirection(any(Direction.class))).thenReturn(true);
when(handler.listMessages(any(Connection.class), any(MessageCriteria.class)))
.thenReturn(Collections.singleton(new Message()));
DataSource dataSource = mockDataSource();
JdbcMessageStore messageStore = createMessageStore(dataSource, handler);