use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata 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);
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class MethodBasedMetadataGenerationTests method methodAndClassConfig.
@Test
void methodAndClassConfig() {
ConfigurationMetadata metadata = compile(MethodAndClassConfig.class);
assertThat(metadata).has(Metadata.withProperty("conflict.name", String.class).fromSource(MethodAndClassConfig.Foo.class));
assertThat(metadata).has(Metadata.withProperty("conflict.flag", Boolean.class).withDefaultValue(false).fromSource(MethodAndClassConfig.Foo.class));
assertThat(metadata).has(Metadata.withProperty("conflict.value", String.class).fromSource(MethodAndClassConfig.class));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class MethodBasedMetadataGenerationTests method methodConfig.
private void methodConfig(Class<?> config, Class<?> properties) {
ConfigurationMetadata metadata = compile(config);
assertThat(metadata).has(Metadata.withGroup("foo").fromSource(config));
assertThat(metadata).has(Metadata.withProperty("foo.name", String.class).fromSource(properties));
assertThat(metadata).has(Metadata.withProperty("foo.flag", Boolean.class).withDefaultValue(false).fromSource(properties));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class MethodBasedMetadataGenerationTests method privateMethodConfig.
@Test
void privateMethodConfig() {
ConfigurationMetadata metadata = compile(PrivateMethodConfig.class);
assertThat(metadata).doesNotHave(Metadata.withGroup("foo"));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class MethodBasedMetadataGenerationTests method singleConstructorMethodConfig.
@Test
void singleConstructorMethodConfig() {
ConfigurationMetadata metadata = compile(SingleConstructorMethodConfig.class);
assertThat(metadata).doesNotHave(Metadata.withProperty("foo.my-service", Object.class).fromSource(SingleConstructorMethodConfig.Foo.class));
assertThat(metadata).has(Metadata.withProperty("foo.name", String.class).fromSource(SingleConstructorMethodConfig.Foo.class));
assertThat(metadata).has(Metadata.withProperty("foo.flag", Boolean.class).withDefaultValue(false).fromSource(SingleConstructorMethodConfig.Foo.class));
}
Aggregations