Closes gh-9330
pull/3743/merge
Johnny Lim 8 years ago committed by Stephane Nicoll
parent 9332a3a4ae
commit 6939ff1e65

@ -195,7 +195,7 @@ public class WebFluxAutoConfigurationTests {
assertThat(validator).isInstanceOf(ValidatorAdapter.class); assertThat(validator).isInstanceOf(ValidatorAdapter.class);
Object defaultValidator = this.context.getBean("defaultValidator"); Object defaultValidator = this.context.getBean("defaultValidator");
assertThat(((ValidatorAdapter) validator).getTarget()).isSameAs(defaultValidator); assertThat(((ValidatorAdapter) validator).getTarget()).isSameAs(defaultValidator);
// Primary Spring validator is the one use by WebFlux behind the scenes // Primary Spring validator is the one used by WebFlux behind the scenes
assertThat(this.context.getBean(Validator.class)).isEqualTo(defaultValidator); assertThat(this.context.getBean(Validator.class)).isEqualTo(defaultValidator);
} }
@ -257,7 +257,7 @@ public class WebFluxAutoConfigurationTests {
assertThat(validator).isInstanceOf(ValidatorAdapter.class); assertThat(validator).isInstanceOf(ValidatorAdapter.class);
Object defaultValidator = this.context.getBean("defaultValidator"); Object defaultValidator = this.context.getBean("defaultValidator");
assertThat(((ValidatorAdapter) validator).getTarget()).isSameAs(defaultValidator); assertThat(((ValidatorAdapter) validator).getTarget()).isSameAs(defaultValidator);
// Primary Spring validator is the one use by WebFlux behind the scenes // Primary Spring validator is the one used by WebFlux behind the scenes
assertThat(this.context.getBean(Validator.class)).isEqualTo(defaultValidator); assertThat(this.context.getBean(Validator.class)).isEqualTo(defaultValidator);
} }

@ -65,7 +65,7 @@ import org.springframework.boot.configurationsample.specific.DoubleRegistrationP
import org.springframework.boot.configurationsample.specific.ExcludedTypesPojo; import org.springframework.boot.configurationsample.specific.ExcludedTypesPojo;
import org.springframework.boot.configurationsample.specific.GenericConfig; import org.springframework.boot.configurationsample.specific.GenericConfig;
import org.springframework.boot.configurationsample.specific.InnerClassAnnotatedGetterConfig; import org.springframework.boot.configurationsample.specific.InnerClassAnnotatedGetterConfig;
import org.springframework.boot.configurationsample.specific.InnerClassHierachicalProperties; import org.springframework.boot.configurationsample.specific.InnerClassHierarchicalProperties;
import org.springframework.boot.configurationsample.specific.InnerClassProperties; import org.springframework.boot.configurationsample.specific.InnerClassProperties;
import org.springframework.boot.configurationsample.specific.InnerClassRootConfig; import org.springframework.boot.configurationsample.specific.InnerClassRootConfig;
import org.springframework.boot.configurationsample.specific.InvalidAccessorProperties; import org.springframework.boot.configurationsample.specific.InvalidAccessorProperties;
@ -350,14 +350,14 @@ public class ConfigurationMetadataAnnotationProcessorTests {
} }
@Test @Test
public void innerClassPropertiesHierachical() throws Exception { public void innerClassPropertiesHierarchical() throws Exception {
ConfigurationMetadata metadata = compile(InnerClassHierachicalProperties.class); ConfigurationMetadata metadata = compile(InnerClassHierarchicalProperties.class);
assertThat(metadata).has(Metadata.withGroup("config.foo") assertThat(metadata).has(Metadata.withGroup("config.foo")
.ofType(InnerClassHierachicalProperties.Foo.class)); .ofType(InnerClassHierarchicalProperties.Foo.class));
assertThat(metadata).has(Metadata.withGroup("config.foo.bar") assertThat(metadata).has(Metadata.withGroup("config.foo.bar")
.ofType(InnerClassHierachicalProperties.Bar.class)); .ofType(InnerClassHierarchicalProperties.Bar.class));
assertThat(metadata).has(Metadata.withGroup("config.foo.bar.baz") assertThat(metadata).has(Metadata.withGroup("config.foo.bar.baz")
.ofType(InnerClassHierachicalProperties.Foo.Baz.class)); .ofType(InnerClassHierarchicalProperties.Foo.Baz.class));
assertThat(metadata).has(Metadata.withProperty("config.foo.bar.baz.blah")); assertThat(metadata).has(Metadata.withProperty("config.foo.bar.baz.blah"));
assertThat(metadata).has(Metadata.withProperty("config.foo.bar.bling")); assertThat(metadata).has(Metadata.withProperty("config.foo.bar.bling"));
} }

@ -26,7 +26,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
* @author Madhura Bhave * @author Madhura Bhave
*/ */
@ConfigurationProperties(prefix = "config") @ConfigurationProperties(prefix = "config")
public class InnerClassHierachicalProperties { public class InnerClassHierarchicalProperties {
private Foo foo; private Foo foo;

@ -1118,7 +1118,7 @@ public class SpringApplication {
* <p> * <p>
* The sources here are added to those that were set in the constructor. Most users * The sources here are added to those that were set in the constructor. Most users
* should consider using {@link #getSources()}/{@link #setSources(Set)} rather than * should consider using {@link #getSources()}/{@link #setSources(Set)} rather than
* this calling method. * calling this method.
* @param additionalPrimarySources the additional primary sources to add * @param additionalPrimarySources the additional primary sources to add
* @see #SpringApplication(Class...) * @see #SpringApplication(Class...)
* @see #getSources() * @see #getSources()

@ -401,7 +401,7 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
} }
for (PropertySourceLoader loader : this.propertySourceLoaders) { for (PropertySourceLoader loader : this.propertySourceLoaders) {
for (String ext : loader.getFileExtensions()) { for (String ext : loader.getFileExtensions()) {
loadForFileExtention(loader, profile, location + name, "." + ext); loadForFileExtension(loader, profile, location + name, "." + ext);
} }
} }
} }
@ -411,7 +411,7 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
.anyMatch(name.toLowerCase()::endsWith); .anyMatch(name.toLowerCase()::endsWith);
} }
private void loadForFileExtention(PropertySourceLoader loader, Profile profile, private void loadForFileExtension(PropertySourceLoader loader, Profile profile,
String prefix, String ext) { String prefix, String ext) {
if (profile != null) { if (profile != null) {
// Try the profile-specific file // Try the profile-specific file

@ -17,7 +17,6 @@
package org.springframework.boot.context.properties.bind; package org.springframework.boot.context.properties.bind;
import org.springframework.boot.context.properties.source.ConfigurationPropertyName; import org.springframework.boot.context.properties.source.ConfigurationPropertyName;
import org.springframework.boot.context.properties.source.ConfigurationPropertySource;
/** /**
* Internal strategy used by {@link Binder} to bind beans. * Internal strategy used by {@link Binder} to bind beans.
@ -31,9 +30,7 @@ interface BeanBinder {
* Return a bound bean instance or {@code null} if the {@link BeanBinder} does not * Return a bound bean instance or {@code null} if the {@link BeanBinder} does not
* support the specified {@link Bindable}. * support the specified {@link Bindable}.
* @param name the name being bound * @param name the name being bound
* @param target the bindable to bind names from underlying * @param target the bindable to bind
* {@link ConfigurationPropertySource} cannot be iterated this method can be
* {@code false}, even though binding may ultimately succeed.
* @param context the bind context * @param context the bind context
* @param propertyBinder property binder * @param propertyBinder property binder
* @param <T> The source type * @param <T> The source type

@ -248,7 +248,7 @@ public class ConfigurationPropertyNameTests {
} }
@Test @Test
public void adapShouldStripInvalidChars() throws Exception { public void adaptShouldStripInvalidChars() throws Exception {
ConfigurationPropertyName name = ConfigurationPropertyName.adapt("f@@.b%r", '.'); ConfigurationPropertyName name = ConfigurationPropertyName.adapt("f@@.b%r", '.');
assertThat(name.getElement(0, Form.UNIFORM)).isEqualTo("f"); assertThat(name.getElement(0, Form.UNIFORM)).isEqualTo("f");
assertThat(name.getElement(0, Form.ORIGINAL)).isEqualTo("f"); assertThat(name.getElement(0, Form.ORIGINAL)).isEqualTo("f");

@ -79,7 +79,7 @@ public class ConfigurationPropertySourcesTests {
} }
@Test @Test
public void environmentProperyExpansionShouldWorkWhenAttached() throws Exception { public void environmentPropertyExpansionShouldWorkWhenAttached() throws Exception {
ConfigurableEnvironment environment = new StandardEnvironment(); ConfigurableEnvironment environment = new StandardEnvironment();
Map<String, Object> source = new LinkedHashMap<>(); Map<String, Object> source = new LinkedHashMap<>();
source.put("fooBar", "Spring ${barBaz} ${bar-baz}"); source.put("fooBar", "Spring ${barBaz} ${bar-baz}");
@ -102,7 +102,7 @@ public class ConfigurationPropertySourcesTests {
} }
@Test @Test
public void fromPropertySourcseShouldFlattenPropertySources() throws Exception { public void fromPropertySourceShouldFlattenPropertySources() throws Exception {
StandardEnvironment environment = new StandardEnvironment(); StandardEnvironment environment = new StandardEnvironment();
environment.getPropertySources().addFirst(new MapPropertySource("foo", environment.getPropertySources().addFirst(new MapPropertySource("foo",
Collections.<String, Object>singletonMap("foo", "bar"))); Collections.<String, Object>singletonMap("foo", "bar")));

Loading…
Cancel
Save