* @see DATACMNS-58
*/
@Test
public void registersXmlInitializerCorrectly() {
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
reader.loadBeanDefinitions(getPopulatorResource());
BeanDefinition definition = beanFactory.getBeanDefinition("xml-populator");
assertThat(definition, is(notNullValue()));
Object bean = beanFactory.getBean("xml-populator");
assertThat(bean, is(instanceOf(ResourceReaderRepositoryPopulator.class)));
Object resourceReader = ReflectionTestUtils.getField(bean, "reader");
assertThat(resourceReader, is(instanceOf(UnmarshallingResourceReader.class)));
Object unmarshaller = ReflectionTestUtils.getField(resourceReader, "unmarshaller");
assertThat(unmarshaller, is(instanceOf(Jaxb2Marshaller.class)));