public void testAutowireConstructor() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, new MutablePropertyValues());
lbf.registerBeanDefinition("spouse", bd);
ConstructorDependenciesBean bean = (ConstructorDependenciesBean)
lbf.autowire(ConstructorDependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, true);
Object spouse = lbf.getBean("spouse");
assertTrue(bean.getSpouse1() == spouse);
assertTrue(BeanFactoryUtils.beanOfType(lbf, TestBean.class) == spouse);
}