BeanDefinition beanDefinition = beanFactory.getBeanDefinition("eventBusTerminalClusterSelector");
assertNotNull("Bean definition not created", beanDefinition);
assertEquals("Wrong bean class", ClusteringEventBus.class.getName(), beanDefinition.getBeanClassName());
assertEquals("wrong amount of constructor arguments"
, 2, beanDefinition.getConstructorArgumentValues().getArgumentCount());
BeanReference selectorRef = (BeanReference) beanDefinition.getConstructorArgumentValues()
.getArgumentValue(0, BeanReference.class)
.getValue();
assertEquals("constructor value is wrong", "clusterSelector", selectorRef.getBeanName());
BeanReference terminalRef = (BeanReference) beanDefinition.getConstructorArgumentValues()
.getArgumentValue(1, BeanReference.class)
.getValue();
assertEquals("constructor value is wrong", "terminal", terminalRef.getBeanName());
assertNotNull(beanFactory.getBean("eventBusTerminalClusterSelector", EventBus.class));
}