use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method innerClassAnnotatedGetterConfig.
@Test
void innerClassAnnotatedGetterConfig() {
ConfigurationMetadata metadata = compile(InnerClassAnnotatedGetterConfig.class);
assertThat(metadata).has(Metadata.withProperty("specific.value"));
assertThat(metadata).has(Metadata.withProperty("foo.name"));
assertThat(metadata).isNotEqualTo(Metadata.withProperty("specific.foo"));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method notAnnotated.
@Test
void notAnnotated() {
ConfigurationMetadata metadata = compile(NotAnnotated.class);
assertThat(metadata).isNull();
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method innerClassPropertiesHierarchical.
@Test
void innerClassPropertiesHierarchical() {
ConfigurationMetadata metadata = compile(InnerClassHierarchicalProperties.class);
assertThat(metadata).has(Metadata.withGroup("config.foo").ofType(InnerClassHierarchicalProperties.Foo.class));
assertThat(metadata).has(Metadata.withGroup("config.foo.bar").ofType(InnerClassHierarchicalProperties.Bar.class));
assertThat(metadata).has(Metadata.withGroup("config.foo.bar.baz").ofType(InnerClassHierarchicalProperties.Foo.Baz.class));
assertThat(metadata).has(Metadata.withProperty("config.foo.bar.baz.blah"));
assertThat(metadata).has(Metadata.withProperty("config.foo.bar.bling"));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class GenericsMetadataGenerationTests method builderPatternWithGenericReturnType.
@Test
void builderPatternWithGenericReturnType() {
ConfigurationMetadata metadata = compile(ConcreteBuilderProperties.class);
assertThat(metadata).has(Metadata.withGroup("builder").fromSource(ConcreteBuilderProperties.class));
assertThat(metadata).has(Metadata.withProperty("builder.number", Integer.class).fromSource(ConcreteBuilderProperties.class));
assertThat(metadata).has(Metadata.withProperty("builder.description", String.class).fromSource(ConcreteBuilderProperties.class));
assertThat(metadata.getItems()).hasSize(3);
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class GenericsMetadataGenerationTests method wildcardTypes.
@Test
void wildcardTypes() {
ConfigurationMetadata metadata = compile(WildcardConfig.class);
assertThat(metadata).has(Metadata.withGroup("wildcard").ofType(WildcardConfig.class));
assertThat(metadata).has(Metadata.withProperty("wildcard.string-to-number").ofType("java.util.Map<java.lang.String,? extends java.lang.Number>").fromSource(WildcardConfig.class));
assertThat(metadata).has(Metadata.withProperty("wildcard.integers").ofType("java.util.List<? super java.lang.Integer>").fromSource(WildcardConfig.class));
assertThat(metadata.getItems()).hasSize(3);
}
Aggregations