use of org.springframework.integration.amqp.config.AmqpChannelFactoryBean in project spring-integration by spring-projects.
the class ChannelTests method testAmqpChannelFactoryBean.
@Test
public void testAmqpChannelFactoryBean() throws Exception {
AmqpChannelFactoryBean channelFactoryBean = new AmqpChannelFactoryBean();
channelFactoryBean.setBeanFactory(mock(BeanFactory.class));
channelFactoryBean.setConnectionFactory(this.connectionFactory);
channelFactoryBean.setBeanName("testChannel");
channelFactoryBean.afterPropertiesSet();
AbstractAmqpChannel channel = channelFactoryBean.getObject();
assertThat(channel, instanceOf(PointToPointSubscribableAmqpChannel.class));
channelFactoryBean = new AmqpChannelFactoryBean();
channelFactoryBean.setBeanFactory(mock(BeanFactory.class));
channelFactoryBean.setConnectionFactory(this.connectionFactory);
channelFactoryBean.setBeanName("testChannel");
channelFactoryBean.setPubSub(true);
channelFactoryBean.afterPropertiesSet();
channel = channelFactoryBean.getObject();
assertThat(channel, instanceOf(PublishSubscribeAmqpChannel.class));
RabbitAdmin rabbitAdmin = new RabbitAdmin(this.connectionFactory);
rabbitAdmin.deleteQueue("testChannel");
rabbitAdmin.deleteExchange("si.fanout.testChannel");
}
Aggregations