use of org.springframework.beans.factory.config.YamlPropertiesFactoryBean in project Asqatasun by Asqatasun.
the class PersistenceConfigTest method propertySourcesPlaceholderConfigurer.
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
yaml.setResources(new ClassPathResource("application-test.yml"));
propertySourcesPlaceholderConfigurer.setProperties(yaml.getObject());
return propertySourcesPlaceholderConfigurer;
}
use of org.springframework.beans.factory.config.YamlPropertiesFactoryBean in project cas by apereo.
the class CasCoreConfigurationUtils method loadYamlProperties.
/**
* Load yaml properties map.
*
* @param resource the resource
* @return the map
*/
public static Map<String, Object> loadYamlProperties(final Resource... resource) {
val factory = new YamlPropertiesFactoryBean();
factory.setResolutionMethod(YamlProcessor.ResolutionMethod.OVERRIDE);
factory.setResources(resource);
factory.setSingleton(true);
factory.afterPropertiesSet();
return (Map) factory.getObject();
}
Aggregations