}
}).when(cf).addConnectionListener(any(ConnectionListener.class));
RabbitAdmin admin = new RabbitAdmin(cf);
RabbitAdmin other = new RabbitAdmin(cf);
GenericApplicationContext context = new GenericApplicationContext();
Queue queue = new Queue("foo");
queue.setAdminsThatShouldDeclare(other);
context.getBeanFactory().registerSingleton("foo", queue);
DirectExchange exchange = new DirectExchange("bar");
exchange.setAdminsThatShouldDeclare(other);
context.getBeanFactory().registerSingleton("bar", exchange);
Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);