Polish contribution

Closes gh-7491
This commit is contained in:
Stephane Nicoll
2016-11-29 15:19:54 +01:00
parent b3220985bb
commit f84fd19eaa
3 changed files with 26 additions and 32 deletions

View File

@@ -352,6 +352,17 @@ public class ConfigurationMetadataAnnotationProcessorTests {
assertThat(metadata).isNotEqualTo(Metadata.withProperty("specific.foo"));
}
@Test
public void nestedClassChildProperties() throws Exception {
ConfigurationMetadata metadata = compile(ClassWithNestedProperties.class);
assertThat(metadata).has(Metadata.withGroup("nestedChildProps")
.fromSource(ClassWithNestedProperties.NestedChildClass.class));
assertThat(metadata).has(Metadata.withProperty("nestedChildProps.child-class-property", Integer.class)
.fromSource(ClassWithNestedProperties.NestedChildClass.class).withDefaultValue(20));
assertThat(metadata).has(Metadata.withProperty("nestedChildProps.parent-class-property", Integer.class)
.fromSource(ClassWithNestedProperties.NestedChildClass.class).withDefaultValue(10));
}
@Test
public void builderPojo() throws IOException {
ConfigurationMetadata metadata = compile(BuilderPojo.class);
@@ -768,17 +779,6 @@ public class ConfigurationMetadataAnnotationProcessorTests {
}
}
@Test
public void nestedClassChildProperties() throws Exception {
ConfigurationMetadata metadata = compile(ClassWithNestedProperties.class);
assertThat(metadata).has(Metadata.withGroup("nestedChildProps")
.fromSource(ClassWithNestedProperties.NestedChildClass.class));
assertThat(metadata).has(Metadata.withProperty("nestedChildProps.child-class-property", Integer.class)
.fromSource(ClassWithNestedProperties.NestedChildClass.class).withDefaultValue(20));
assertThat(metadata).has(Metadata.withProperty("nestedChildProps.parent-class-property", Integer.class)
.fromSource(ClassWithNestedProperties.NestedChildClass.class).withDefaultValue(10));
}
private static class AdditionalMetadata {
}