Search in sources :

Example 1 with SimpleProperties

use of org.springframework.boot.configurationsample.simple.SimpleProperties in project spring-boot by spring-projects.

the class ConfigurationMetadataAnnotationProcessorTests method simpleProperties.

@Test
void simpleProperties() {
    ConfigurationMetadata metadata = compile(SimpleProperties.class);
    assertThat(metadata).has(Metadata.withGroup("simple").fromSource(SimpleProperties.class));
    assertThat(metadata).has(Metadata.withProperty("simple.the-name", String.class).fromSource(SimpleProperties.class).withDescription("The name of this simple properties.").withDefaultValue("boot").withDeprecation(null, null));
    assertThat(metadata).has(Metadata.withProperty("simple.flag", Boolean.class).withDefaultValue(false).fromSource(SimpleProperties.class).withDescription("A simple flag.").withDeprecation(null, null));
    assertThat(metadata).has(Metadata.withProperty("simple.comparator"));
    assertThat(metadata).doesNotHave(Metadata.withProperty("simple.counter"));
    assertThat(metadata).doesNotHave(Metadata.withProperty("simple.size"));
}
Also used : SimpleProperties(org.springframework.boot.configurationsample.simple.SimpleProperties) ConfigurationMetadata(org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 ConfigurationMetadata (org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata)1 SimpleProperties (org.springframework.boot.configurationsample.simple.SimpleProperties)1