@Test public void testPubSubDomainOverride() { load(TestConfiguration.class, "spring.jms.pubSubDomain:false"); JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class); ActiveMQConnectionFactory connectionFactory = this.context.getBean(ActiveMQConnectionFactory.class); assertThat(jmsTemplate).isNotNull(); assertThat(jmsTemplate.isPubSubDomain()).isFalse(); assertThat(connectionFactory).isNotNull(); assertThat(connectionFactory).isEqualTo(jmsTemplate.getConnectionFactory()); }
@Test public void testPubSubDomainActive() { load(TestConfiguration.class, "spring.jms.pubSubDomain:true"); JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class); DefaultMessageListenerContainer defaultMessageListenerContainer = this.context .getBean(DefaultJmsListenerContainerFactory.class) .createListenerContainer(mock(JmsListenerEndpoint.class)); assertThat(jmsTemplate.isPubSubDomain()).isTrue(); assertThat(defaultMessageListenerContainer.isPubSubDomain()).isTrue(); }
@Test public void testJmsTemplatePostProcessedSoThatPubSubIsTrue() { load(TestConfiguration4.class); JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class); assertThat(jmsTemplate.isPubSubDomain()).isTrue(); }
@Test public void testPubSubDisabledByDefault() { load(TestConfiguration.class); JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class); assertThat(jmsTemplate.isPubSubDomain()).isFalse(); }