use of org.springframework.boot.bind.PropertySourcesPropertyValues in project spring-boot by spring-projects.
the class SpringProfileDocumentMatcher method extractSpringProfiles.
protected List<String> extractSpringProfiles(Properties properties) {
SpringProperties springProperties = new SpringProperties();
MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new PropertiesPropertySource("profiles", properties));
PropertyValues propertyValues = new PropertySourcesPropertyValues(propertySources);
new RelaxedDataBinder(springProperties, "spring").bind(propertyValues);
List<String> profiles = springProperties.getProfiles();
return profiles;
}
use of org.springframework.boot.bind.PropertySourcesPropertyValues in project spring-boot by spring-projects.
the class MustacheEnvironmentCollector method setEnvironment.
@Override
public void setEnvironment(Environment environment) {
this.environment = (ConfigurableEnvironment) environment;
this.target = new HashMap<>();
new RelaxedDataBinder(this.target).bind(new PropertySourcesPropertyValues(this.environment.getPropertySources()));
this.propertyResolver = new RelaxedPropertyResolver(environment);
}
Aggregations