use of org.springframework.boot.context.properties.source.MapConfigurationPropertySource in project spring-boot by spring-projects.
the class MapBinderTests method bindToMapWhenMultipleInSameSourceCandidateShouldBindFirst.
@Test
void bindToMapWhenMultipleInSameSourceCandidateShouldBindFirst() {
Map<String, Object> map = new HashMap<>();
map.put("foo.bar", "1");
map.put("foo.b-az", "2");
map.put("foo.ba-z", "3");
map.put("foo.bin", "4");
MapConfigurationPropertySource propertySource = new MapConfigurationPropertySource(map);
this.sources.add(propertySource);
Map<String, Integer> result = this.binder.bind("foo", STRING_INTEGER_MAP).get();
assertThat(result).hasSize(4);
assertThat(result).containsEntry("bar", 1);
assertThat(result).containsEntry("b-az", 2);
assertThat(result).containsEntry("ba-z", 3);
assertThat(result).containsEntry("bin", 4);
}
use of org.springframework.boot.context.properties.source.MapConfigurationPropertySource 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.MapConfigurationPropertySource 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.MapConfigurationPropertySource 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.MapConfigurationPropertySource 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