use of org.springframework.boot.configurationsample.lombok.LombokInnerClassProperties in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method lombokInnerClassProperties.
@Test
public void lombokInnerClassProperties() throws Exception {
ConfigurationMetadata metadata = compile(LombokInnerClassProperties.class);
assertThat(metadata).has(Metadata.withGroup("config").fromSource(LombokInnerClassProperties.class));
assertThat(metadata).has(Metadata.withGroup("config.first").ofType(LombokInnerClassProperties.Foo.class).fromSource(LombokInnerClassProperties.class));
assertThat(metadata).has(Metadata.withProperty("config.first.name"));
assertThat(metadata).has(Metadata.withProperty("config.first.bar.name"));
assertThat(metadata).has(Metadata.withGroup("config.second", LombokInnerClassProperties.Foo.class).fromSource(LombokInnerClassProperties.class));
assertThat(metadata).has(Metadata.withProperty("config.second.name"));
assertThat(metadata).has(Metadata.withProperty("config.second.bar.name"));
assertThat(metadata).has(Metadata.withGroup("config.third").ofType(SimpleLombokPojo.class).fromSource(LombokInnerClassProperties.class));
// For some reason the annotation processor resolves a type for SimpleLombokPojo
// that is resolved (compiled) and the source annotations are gone. Because we
// don't see the @Data annotation anymore, no field is harvested. What is crazy is
// that a sample project works fine so this seem to be related to the unit test
// environment for some reason. assertThat(metadata,
// containsProperty("config.third.value"));
assertThat(metadata).has(Metadata.withProperty("config.fourth"));
assertThat(metadata).isNotEqualTo(Metadata.withGroup("config.fourth"));
}
Aggregations