JmsConsumer extends JmsConsumerImpl { protected Boolean deferConsumerCreationToVendor() { return BooleanUtils.toBooleanDefaultIfNull(getDeferConsumerCreationToVendor(), false); } JmsConsumer();   JmsConsumer(boolean transacted); JmsConsumer withEndpoint(String s);  }
@Test public void testDeferConsumerCreationToVendor() throws Exception { Assume.assumeTrue(JmsConfig.jmsTestsEnabled()); when(mockVendor.createConsumer(any(), any(), any(JmsActorConfig.class))).thenReturn(mockMessageConsumer); when(mockVendor.getBrokerUrl()) .thenReturn("vm: ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm: when(mockVendor.createConnectionFactory()).thenReturn(factory); when(mockVendor.createConnection(any(), any())).thenReturn(factory.createConnection()); String rfc6167 = "jms:topic:" + getName() + "?subscriptionId=" + getName(); JmsConsumer consumer = new JmsConsumer().withEndpoint(rfc6167); consumer.setAcknowledgeMode("AUTO_ACKNOWLEDGE"); consumer.setDeferConsumerCreationToVendor(true); JmsConnection jmsConnection = activeMqBroker.getJmsConnection(); jmsConnection.setVendorImplementation(mockVendor); StandaloneConsumer standaloneConsumer = new StandaloneConsumer(jmsConnection, consumer); MockMessageListener jms = new MockMessageListener(); standaloneConsumer.registerAdaptrisMessageListener(jms); LifecycleHelper.initAndStart(standaloneConsumer); verify(mockVendor).createConsumer(any(), any(), any(JmsConsumer.class)); LifecycleHelper.stopAndClose(standaloneConsumer); }