@Test
public void testPoll() throws Exception {

    JmsSinkConnector connector = new JmsSinkConnector();
    connector.start(testProperties);
    ApplicationContext context = ApplicationContextHolder.getApplicationContext();
    ListeningContainerMessageReceiver messageReceiver = context
            .getBean(ListeningContainerMessageReceiver.class,
                    context.getBean(ConnectionFactory.class),
                    context.getBean(JmsConnectorConfigurationProperties.class),
                    context.getBean(TopicsMappingHolder.class),
                    "testQueue");
    Assert.assertNotNull(messageReceiver.poll());
    messageReceiver.commitIfNecessary();
    connector.stop();
}