@Test
public void testAdminSkipsMismatchedQueue() throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
context.setConfigLocation("org/springframework/amqp/rabbit/config/MismatchedQueueDeclarationTests-context.xml");
StandardEnvironment env = new StandardEnvironment();
env.addActiveProfile("advancedAdmin");
env.addActiveProfile("basic");
context.setEnvironment(env);
context.refresh();
context.getBean(CachingConnectionFactory.class).createConnection();
context.destroy();
Channel channel = this.connectionFactory.createConnection().createChannel(false);
channel.queueDeclarePassive("mismatch.bar");
this.admin.deleteQueue("mismatch.bar");
assertNotNull(this.admin.getQueueProperties("mismatch.foo"));
assertNull(this.admin.getQueueProperties("mismatch.bar"));
env = new StandardEnvironment();
env.addActiveProfile("advancedAdmin");
env.addActiveProfile("ttl");
context.setEnvironment(env);
context.refresh();
channel = this.connectionFactory.createConnection().createChannel(false);
context.getBean(CachingConnectionFactory.class).createConnection();
assertNotNull(this.admin.getQueueProperties("mismatch.foo"));