use of org.springframework.jms.config.JmsListenerEndpointRegistry in project spring-framework by spring-projects.
the class EnableJmsTests method containerCanBeStarterViaTheRegistry.
@Test
@SuppressWarnings("resource")
void containerCanBeStarterViaTheRegistry() {
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EnableJmsAutoStartupFalseConfig.class, DefaultBean.class);
JmsListenerContainerTestFactory factory = context.getBean(JmsListenerContainerTestFactory.class);
MessageListenerTestContainer container = factory.getListenerContainers().get(0);
assertThat(container.isAutoStartup()).isFalse();
assertThat(container.isStarted()).isFalse();
JmsListenerEndpointRegistry registry = context.getBean(JmsListenerEndpointRegistry.class);
registry.start();
assertThat(container.isStarted()).isTrue();
}
Aggregations