Search in sources :

Example 1 with ImmutableSimpleProperties

use of org.springframework.boot.configurationsample.immutable.ImmutableSimpleProperties in project spring-boot by spring-projects.

the class ImmutablePropertiesMetadataGenerationTests method immutableSimpleProperties.

@Test
void immutableSimpleProperties() {
    ConfigurationMetadata metadata = compile(ImmutableSimpleProperties.class);
    assertThat(metadata).has(Metadata.withGroup("immutable").fromSource(ImmutableSimpleProperties.class));
    assertThat(metadata).has(Metadata.withProperty("immutable.the-name", String.class).fromSource(ImmutableSimpleProperties.class).withDescription("The name of this simple properties.").withDefaultValue("boot"));
    assertThat(metadata).has(Metadata.withProperty("immutable.flag", Boolean.class).withDefaultValue(false).fromSource(ImmutableSimpleProperties.class).withDescription("A simple flag.").withDeprecation(null, null));
    assertThat(metadata).has(Metadata.withProperty("immutable.comparator"));
    assertThat(metadata).has(Metadata.withProperty("immutable.counter"));
    assertThat(metadata.getItems()).hasSize(5);
}
Also used : ImmutableSimpleProperties(org.springframework.boot.configurationsample.immutable.ImmutableSimpleProperties) 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 ImmutableSimpleProperties (org.springframework.boot.configurationsample.immutable.ImmutableSimpleProperties)1