use of org.springframework.boot.context.properties.source.ConfigurationPropertySource in project spring-boot by spring-projects.
the class SpringBootTestContextBootstrapper method getWebApplicationType.
private WebApplicationType getWebApplicationType(MergedContextConfiguration configuration) {
ConfigurationPropertySource source = new MapConfigurationPropertySource(TestPropertySourceUtils.convertInlinedPropertiesToMap(configuration.getPropertySourceProperties()));
Binder binder = new Binder(source);
return binder.bind("spring.main.web-application-type", Bindable.of(WebApplicationType.class)).orElseGet(this::deduceWebApplicationType);
}
use of org.springframework.boot.context.properties.source.ConfigurationPropertySource in project spring-boot by spring-projects.
the class ServerPropertiesTests method bind.
private void bind(Map<String, String> map) {
ConfigurationPropertySource source = new MapConfigurationPropertySource(map);
new Binder(source).bind("server", Bindable.ofInstance(this.properties));
}
use of org.springframework.boot.context.properties.source.ConfigurationPropertySource in project spring-boot by spring-projects.
the class Saml2RelyingPartyPropertiesTests method bind.
private void bind(Map<String, String> map) {
ConfigurationPropertySource source = new MapConfigurationPropertySource(map);
new Binder(source).bind("spring.security.saml2.relyingparty", Bindable.ofInstance(this.properties));
}
use of org.springframework.boot.context.properties.source.ConfigurationPropertySource in project spring-boot by spring-projects.
the class ConfigDataEnvironment method getIncludedProfiles.
private Collection<? extends String> getIncludedProfiles(ConfigDataEnvironmentContributors contributors, ConfigDataActivationContext activationContext) {
PlaceholdersResolver placeholdersResolver = new ConfigDataEnvironmentContributorPlaceholdersResolver(contributors, activationContext, null, true);
Set<String> result = new LinkedHashSet<>();
for (ConfigDataEnvironmentContributor contributor : contributors) {
ConfigurationPropertySource source = contributor.getConfigurationPropertySource();
if (source != null && !contributor.hasConfigDataOption(ConfigData.Option.IGNORE_PROFILES)) {
Binder binder = new Binder(Collections.singleton(source), placeholdersResolver);
binder.bind(Profiles.INCLUDE_PROFILES, STRING_LIST).ifBound((includes) -> {
if (!contributor.isActive(activationContext)) {
InactiveConfigDataAccessException.throwIfPropertyFound(contributor, Profiles.INCLUDE_PROFILES);
InactiveConfigDataAccessException.throwIfPropertyFound(contributor, Profiles.INCLUDE_PROFILES.append("[0]"));
}
result.addAll(includes);
});
}
}
return result;
}
use of org.springframework.boot.context.properties.source.ConfigurationPropertySource in project spring-boot by spring-projects.
the class ServletWebServerFactoryCustomizerTests method bindProperties.
private void bindProperties(Map<String, String> map) {
ConfigurationPropertySource source = new MapConfigurationPropertySource(map);
new Binder(source).bind("server", Bindable.ofInstance(this.properties));
}
Aggregations