JmsSyncConsumer extends BaseJmsPollingConsumerImpl { @Override protected MessageConsumer createConsumer() throws JMSException { String rfc6167 = endpoint(); String filterExp = messageSelector(); VendorImplementation vendor = retrieveConnection(JmsConnection.class).configuredVendorImplementation(); return new JmsMessageConsumerFactory(vendor, currentSession(), rfc6167, deferConsumerCreationToVendor(), filterExp, this) .create(); } JmsSyncConsumer(); JmsSyncConsumer withEndpoint(String s); @Override Logger currentLogger(); @Override void init();  }
@Test public void testDefaultFalseDeferConsumerCreationToVendor() throws Exception { Assume.assumeTrue(JmsConfig.jmsTestsEnabled()); EmbeddedActiveMq activeMqBroker = new EmbeddedActiveMq(); when(mockVendor.createConsumer(any(JmsDestination.class), any(String.class), any(JmsActorConfig.class))) .thenReturn(mockMessageConsumer); when(mockVendor.getBrokerUrl()).thenReturn("vm: when(mockVendor.createConnectionFactory()).thenReturn(new ActiveMQConnectionFactory("vm: try { activeMqBroker.start(); JmsConnection jmsConnection = activeMqBroker.getJmsConnection(); jmsConnection.setVendorImplementation(mockVendor); StandaloneConsumer standaloneConsumer = createStandaloneConsumer(jmsConnection, false, false); MockMessageListener jms = new MockMessageListener(); standaloneConsumer.registerAdaptrisMessageListener(jms); try { LifecycleHelper.initAndStart(standaloneConsumer); } catch (Exception ex) { } verify(mockVendor, times(0)).createConsumer(any(JmsDestination.class), any(String.class), any(JmsActorConfig.class)); LifecycleHelper.stopAndClose(standaloneConsumer); } finally { activeMqBroker.destroy(); } }