use of org.springframework.jms.core.JmsTemplate in project spring-boot by spring-projects.
the class JmsAutoConfigurationTests method testJmsTemplateWithDestinationResolver.
@Test
public void testJmsTemplateWithDestinationResolver() {
load(DestinationResolversConfiguration.class);
JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
assertThat(jmsTemplate.getDestinationResolver()).isSameAs(this.context.getBean("myDestinationResolver"));
}
use of org.springframework.jms.core.JmsTemplate in project spring-boot by spring-projects.
the class ArtemisAutoConfigurationTests method nativeConnectionFactoryCredentials.
@Test
public void nativeConnectionFactoryCredentials() {
load(EmptyConfiguration.class, "spring.artemis.mode:native", "spring.artemis.user:user", "spring.artemis.password:secret");
JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
ActiveMQConnectionFactory connectionFactory = this.context.getBean(ActiveMQConnectionFactory.class);
assertThat(connectionFactory).isEqualTo(jmsTemplate.getConnectionFactory());
assertNettyConnectionFactory(connectionFactory, "localhost", 61616);
assertThat(connectionFactory.getUser()).isEqualTo("user");
assertThat(connectionFactory.getPassword()).isEqualTo("secret");
}
use of org.springframework.jms.core.JmsTemplate in project spring-boot by spring-projects.
the class JmsAutoConfigurationTests method testJmsTemplateWithMessageConverter.
@Test
public void testJmsTemplateWithMessageConverter() {
load(MessageConvertersConfiguration.class);
JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
assertThat(jmsTemplate.getMessageConverter()).isSameAs(this.context.getBean("myMessageConverter"));
}
use of org.springframework.jms.core.JmsTemplate in project spring-boot by spring-projects.
the class JmsAutoConfigurationTests method testJmsTemplateBackOffEverything.
@Test
public void testJmsTemplateBackOffEverything() {
this.context = createContext(TestConfiguration2.class, TestConfiguration3.class, TestConfiguration5.class);
JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
assertThat(jmsTemplate.getPriority()).isEqualTo(999);
assertThat(this.context.getBean(ActiveMQConnectionFactory.class).getBrokerURL()).isEqualTo("foobar");
JmsMessagingTemplate messagingTemplate = this.context.getBean(JmsMessagingTemplate.class);
assertThat(messagingTemplate.getDefaultDestinationName()).isEqualTo("fooBar");
assertThat(messagingTemplate.getJmsTemplate()).isEqualTo(jmsTemplate);
}
use of org.springframework.jms.core.JmsTemplate in project spring-boot by spring-projects.
the class JmsAutoConfigurationTests method testActiveMQOverriddenRemoteHost.
@Test
public void testActiveMQOverriddenRemoteHost() {
load(TestConfiguration.class, "spring.activemq.brokerUrl:tcp://remote-host:10000");
JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
ActiveMQConnectionFactory connectionFactory = this.context.getBean(ActiveMQConnectionFactory.class);
assertThat(jmsTemplate).isNotNull();
assertThat(connectionFactory).isNotNull();
assertThat(connectionFactory).isEqualTo(jmsTemplate.getConnectionFactory());
assertThat(((ActiveMQConnectionFactory) jmsTemplate.getConnectionFactory()).getBrokerURL()).isEqualTo("tcp://remote-host:10000");
}
Aggregations