use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method typBoxing.
@Test
void typBoxing() {
Class<?> type = BoxingPojo.class;
ConfigurationMetadata metadata = compile(type);
assertThat(metadata).has(Metadata.withGroup("boxing").fromSource(type));
assertThat(metadata).has(Metadata.withProperty("boxing.flag", Boolean.class).withDefaultValue(false).fromSource(type));
assertThat(metadata).has(Metadata.withProperty("boxing.another-flag", Boolean.class).fromSource(type));
assertThat(metadata).has(Metadata.withProperty("boxing.counter", Integer.class).fromSource(type));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method hierarchicalProperties.
@Test
void hierarchicalProperties() {
ConfigurationMetadata metadata = compile(HierarchicalProperties.class, HierarchicalPropertiesParent.class, HierarchicalPropertiesGrandparent.class);
assertThat(metadata).has(Metadata.withGroup("hierarchical").fromSource(HierarchicalProperties.class));
assertThat(metadata).has(Metadata.withProperty("hierarchical.first", String.class).withDefaultValue("one").fromSource(HierarchicalProperties.class));
assertThat(metadata).has(Metadata.withProperty("hierarchical.second", String.class).withDefaultValue("two").fromSource(HierarchicalProperties.class));
assertThat(metadata).has(Metadata.withProperty("hierarchical.third", String.class).withDefaultValue("three").fromSource(HierarchicalProperties.class));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method descriptionProperties.
@Test
void descriptionProperties() {
ConfigurationMetadata metadata = compile(DescriptionProperties.class);
assertThat(metadata).has(Metadata.withGroup("description").fromSource(DescriptionProperties.class));
assertThat(metadata).has(Metadata.withProperty("description.simple", String.class).fromSource(DescriptionProperties.class).withDescription("A simple description."));
assertThat(metadata).has(Metadata.withProperty("description.multi-line", String.class).fromSource(DescriptionProperties.class).withDescription("This is a lengthy description that spans across multiple lines to showcase that the line separators are cleaned automatically."));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method deprecatedProperties.
@Test
@SuppressWarnings("deprecation")
void deprecatedProperties() {
Class<?> type = org.springframework.boot.configurationsample.simple.DeprecatedProperties.class;
ConfigurationMetadata metadata = compile(type);
assertThat(metadata).has(Metadata.withGroup("deprecated").fromSource(type));
assertThat(metadata).has(Metadata.withProperty("deprecated.name", String.class).fromSource(type).withDeprecation(null, null));
assertThat(metadata).has(Metadata.withProperty("deprecated.description", String.class).fromSource(type).withDeprecation(null, null));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method deprecatedOnUnrelatedSetter.
@Test
void deprecatedOnUnrelatedSetter() {
Class<?> type = DeprecatedUnrelatedMethodPojo.class;
ConfigurationMetadata metadata = compile(type);
assertThat(metadata).has(Metadata.withGroup("not.deprecated").fromSource(type));
assertThat(metadata).has(Metadata.withProperty("not.deprecated.counter", Integer.class).withNoDeprecation().fromSource(type));
assertThat(metadata).has(Metadata.withProperty("not.deprecated.flag", Boolean.class).withDefaultValue(false).withNoDeprecation().fromSource(type));
}
Aggregations