Search in sources :

Example 1 with ComplexGenericProperties

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

the class GenericsMetadataGenerationTests method complexGenericProperties.

@Test
void complexGenericProperties() {
    ConfigurationMetadata metadata = compile(ComplexGenericProperties.class);
    assertThat(metadata).has(Metadata.withGroup("generic").fromSource(ComplexGenericProperties.class));
    assertThat(metadata).has(Metadata.withGroup("generic.test").ofType(UpperBoundGenericPojo.class).fromSource(ComplexGenericProperties.class));
    assertThat(metadata).has(Metadata.withProperty("generic.test.mappings", "java.util.Map<java.lang.Enum<T>,java.lang.String>").fromSource(UpperBoundGenericPojo.class));
    assertThat(metadata.getItems()).hasSize(3);
}
Also used : ComplexGenericProperties(org.springframework.boot.configurationsample.generic.ComplexGenericProperties) UpperBoundGenericPojo(org.springframework.boot.configurationsample.generic.UpperBoundGenericPojo) 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 ComplexGenericProperties (org.springframework.boot.configurationsample.generic.ComplexGenericProperties)1 UpperBoundGenericPojo (org.springframework.boot.configurationsample.generic.UpperBoundGenericPojo)1