This commit is contained in:
Phillip Webb
2017-05-15 17:16:03 -07:00
parent 226db4697f
commit 302f038e84
27 changed files with 91 additions and 80 deletions

View File

@@ -352,12 +352,12 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
public void innerClassPropertiesHierachical() throws Exception {
ConfigurationMetadata metadata = compile(InnerClassHierachicalProperties.class);
assertThat(metadata)
.has(Metadata.withGroup("config.foo").ofType(InnerClassHierachicalProperties.Foo.class));
assertThat(metadata).has(
Metadata.withGroup("config.foo.bar").ofType(InnerClassHierachicalProperties.Bar.class));
assertThat(metadata).has(
Metadata.withGroup("config.foo.bar.baz").ofType(InnerClassHierachicalProperties.Foo.Baz.class));
assertThat(metadata).has(Metadata.withGroup("config.foo")
.ofType(InnerClassHierachicalProperties.Foo.class));
assertThat(metadata).has(Metadata.withGroup("config.foo.bar")
.ofType(InnerClassHierachicalProperties.Bar.class));
assertThat(metadata).has(Metadata.withGroup("config.foo.bar.baz")
.ofType(InnerClassHierachicalProperties.Foo.Baz.class));
assertThat(metadata).has(Metadata.withProperty("config.foo.bar.baz.blah"));
assertThat(metadata).has(Metadata.withProperty("config.foo.bar.bling"));
}
@@ -505,8 +505,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
public void lombokInnerClassWithGetterProperties() throws IOException {
ConfigurationMetadata metadata =
compile(LombokInnerClassWithGetterProperties.class);
ConfigurationMetadata metadata = compile(
LombokInnerClassWithGetterProperties.class);
assertThat(metadata).has(Metadata.withGroup("config")
.fromSource(LombokInnerClassWithGetterProperties.class));
assertThat(metadata).has(Metadata.withGroup("config.first")

View File

@@ -19,8 +19,8 @@ package org.springframework.boot.configurationsample.specific;
import org.springframework.boot.configurationsample.ConfigurationProperties;
/**
* Demonstrate inner classes end up in metadata regardless of
* position in hierarchy and without the use of
* Demonstrate inner classes end up in metadata regardless of position in hierarchy and
* without the use of
* {@link org.springframework.boot.configurationsample.NestedConfigurationProperty}.
*
* @author Madhura Bhave
@@ -61,7 +61,9 @@ public class InnerClassHierachicalProperties {
public void setBlah(String blah) {
this.blah = blah;
}
}
}
public static class Bar {
@@ -85,6 +87,7 @@ public class InnerClassHierachicalProperties {
public void setBaz(Foo.Baz baz) {
this.baz = baz;
}
}
}