XmlConfiguratorFactoryBean extends AbstractFactoryBean<ProtocolStackConfigurator> { public void setResource(Resource resource) { this.resource = resource; }  @Override Class<?> getObjectType(); void setResource(Resource resource);  }
@Test public void should_load_configuration_from_xml_file() throws Exception { XmlConfiguratorFactoryBean factoryBean = new XmlConfiguratorFactoryBean(); factoryBean.setResource(new ClassPathResource("/udp.xml")); factoryBean.afterPropertiesSet(); ProtocolStackConfigurator configurator = factoryBean.getObject(); assertThat(configurator.getProtocolStack()).isNotEmpty(); }