}
@Test
public void testChangeQueues() throws Exception {
ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
Connection connection = mock(Connection.class);
Channel channel1 = mock(Channel.class);
Channel channel2 = mock(Channel.class);
when(channel1.isOpen()).thenReturn(true);
when(channel2.isOpen()).thenReturn(true);
when(connectionFactory.createConnection()).thenReturn(connection);
when(connection.createChannel(false)).thenReturn(channel1, channel2);
List<Consumer> consumers = new ArrayList<Consumer>();
AtomicInteger consumerTag = new AtomicInteger();
CountDownLatch latch1 = new CountDownLatch(1);
CountDownLatch latch2 = new CountDownLatch(2);
setupMockConsume(channel1, consumers, consumerTag, latch1);