Search in sources :

Example 1 with SimpleGenericProperties

use of org.springframework.boot.configurationsample.generic.SimpleGenericProperties in project spring-boot by spring-projects.

the class GenericsMetadataGenerationTests method simpleGenericProperties.

@Test
void simpleGenericProperties() {
    ConfigurationMetadata metadata = compile(AbstractGenericProperties.class, SimpleGenericProperties.class);
    assertThat(metadata).has(Metadata.withGroup("generic").fromSource(SimpleGenericProperties.class));
    assertThat(metadata).has(Metadata.withProperty("generic.name", String.class).fromSource(SimpleGenericProperties.class).withDescription("Generic name.").withDefaultValue(null));
    assertThat(metadata).has(Metadata.withProperty("generic.mappings", "java.util.Map<java.lang.Integer,java.time.Duration>").fromSource(SimpleGenericProperties.class).withDescription("Generic mappings.").withDefaultValue(null));
    assertThat(metadata.getItems()).hasSize(3);
}
Also used : SimpleGenericProperties(org.springframework.boot.configurationsample.generic.SimpleGenericProperties) 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 SimpleGenericProperties (org.springframework.boot.configurationsample.generic.SimpleGenericProperties)1