Search in sources :

Example 1 with DeprecatedMethodConfig

use of org.springframework.boot.configurationsample.method.DeprecatedMethodConfig in project spring-boot by spring-projects.

the class ConfigurationMetadataAnnotationProcessorTests method deprecatedMethodConfig.

@Test
public void deprecatedMethodConfig() throws Exception {
    Class<DeprecatedMethodConfig> type = DeprecatedMethodConfig.class;
    ConfigurationMetadata metadata = compile(type);
    assertThat(metadata).has(Metadata.withGroup("foo").fromSource(type));
    assertThat(metadata).has(Metadata.withProperty("foo.name", String.class).fromSource(DeprecatedMethodConfig.Foo.class).withDeprecation(null, null));
    assertThat(metadata).has(Metadata.withProperty("foo.flag", Boolean.class).fromSource(DeprecatedMethodConfig.Foo.class).withDeprecation(null, null));
}
Also used : DeprecatedMethodConfig(org.springframework.boot.configurationsample.method.DeprecatedMethodConfig) ConfigurationMetadata(org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata) Test(org.junit.Test)

Example 2 with DeprecatedMethodConfig

use of org.springframework.boot.configurationsample.method.DeprecatedMethodConfig in project spring-boot by spring-projects.

the class MethodBasedMetadataGenerationTests method deprecatedMethodConfig.

@Test
void deprecatedMethodConfig() {
    Class<DeprecatedMethodConfig> type = DeprecatedMethodConfig.class;
    ConfigurationMetadata metadata = compile(type);
    assertThat(metadata).has(Metadata.withGroup("foo").fromSource(type));
    assertThat(metadata).has(Metadata.withProperty("foo.name", String.class).fromSource(DeprecatedMethodConfig.Foo.class).withDeprecation(null, null));
    assertThat(metadata).has(Metadata.withProperty("foo.flag", Boolean.class).withDefaultValue(false).fromSource(DeprecatedMethodConfig.Foo.class).withDeprecation(null, null));
}
Also used : DeprecatedMethodConfig(org.springframework.boot.configurationsample.method.DeprecatedMethodConfig) ConfigurationMetadata(org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigurationMetadata (org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata)2 DeprecatedMethodConfig (org.springframework.boot.configurationsample.method.DeprecatedMethodConfig)2 Test (org.junit.Test)1 Test (org.junit.jupiter.api.Test)1