when(mockExchange2.getName()).thenReturn("exchange2");
Exchange mockExchange3 = mock(Exchange.class);
when(mockExchange3.getName()).thenReturn("exchange3");
VirtualHost mockVirtualHost = mock(VirtualHost.class);
when(mockVirtualHost.getExchanges()).thenReturn(Arrays.asList(new Exchange[] {mockExchange1, mockExchange2, mockExchange3}));
when(_mockQueue.getParent(VirtualHost.class)).thenReturn(mockVirtualHost);
_queueMBean.setAlternateExchange("exchange2");
verify(_mockQueue).setAttribute(Queue.ALTERNATE_EXCHANGE, null, mockExchange2);
}