Search in sources :

Example 1 with InnerClassProperties

use of org.springframework.boot.configurationsample.specific.InnerClassProperties in project spring-boot by spring-projects.

the class ConfigurationMetadataAnnotationProcessorTests method innerClassProperties.

@Test
public void innerClassProperties() throws Exception {
    ConfigurationMetadata metadata = compile(InnerClassProperties.class);
    assertThat(metadata).has(Metadata.withGroup("config").fromSource(InnerClassProperties.class));
    assertThat(metadata).has(Metadata.withGroup("config.first").ofType(InnerClassProperties.Foo.class).fromSource(InnerClassProperties.class));
    assertThat(metadata).has(Metadata.withProperty("config.first.name"));
    assertThat(metadata).has(Metadata.withProperty("config.first.bar.name"));
    assertThat(metadata).has(Metadata.withGroup("config.the-second", InnerClassProperties.Foo.class).fromSource(InnerClassProperties.class));
    assertThat(metadata).has(Metadata.withProperty("config.the-second.name"));
    assertThat(metadata).has(Metadata.withProperty("config.the-second.bar.name"));
    assertThat(metadata).has(Metadata.withGroup("config.third").ofType(SimplePojo.class).fromSource(InnerClassProperties.class));
    assertThat(metadata).has(Metadata.withProperty("config.third.value"));
    assertThat(metadata).has(Metadata.withProperty("config.fourth"));
    assertThat(metadata).isNotEqualTo(Metadata.withGroup("config.fourth"));
}
Also used : InnerClassProperties(org.springframework.boot.configurationsample.specific.InnerClassProperties) LombokInnerClassProperties(org.springframework.boot.configurationsample.lombok.LombokInnerClassProperties) ConfigurationMetadata(org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ConfigurationMetadata (org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata)1 LombokInnerClassProperties (org.springframework.boot.configurationsample.lombok.LombokInnerClassProperties)1 InnerClassProperties (org.springframework.boot.configurationsample.specific.InnerClassProperties)1