@Test
public void testClusterIsCreatedAfterContainerStart() {
testSubject.registerCluster(new SimpleCluster("cluster1"),
new DefaultAMQPConsumerConfiguration("Queue1"),
new DefaultAMQPMessageConverter(serializer));
assertEquals(1, containersCreated.size());
Object messageListener = containersCreated.get(0).getMessageListener();
verify((ClusterMessageListener) messageListener, never()).addCluster(isA(SimpleCluster.class));
testSubject.start();
testSubject.registerCluster(new SimpleCluster("cluster2"),
new DefaultAMQPConsumerConfiguration("Queue1"),
new DefaultAMQPMessageConverter(serializer));
assertTrue(messageListener instanceof ClusterMessageListener);
// the first cluster is added in the constructor
verify((ClusterMessageListener) messageListener, times(1)).addCluster(isA(SimpleCluster.class));
}