Search in sources :

Example 6 with ItemDeprecation

use of org.springframework.boot.configurationprocessor.metadata.ItemDeprecation in project spring-boot by spring-projects.

the class ConfigurationMetadataAnnotationProcessorTests method mergeExistingPropertyDeprecationOverride.

@Test
public void mergeExistingPropertyDeprecationOverride() throws Exception {
    ItemMetadata property = ItemMetadata.newProperty("singledeprecated", "name", null, null, null, null, null, new ItemDeprecation("Don't use this.", "single.name"));
    writeAdditionalMetadata(property);
    ConfigurationMetadata metadata = compile(DeprecatedSingleProperty.class);
    assertThat(metadata).has(Metadata.withProperty("singledeprecated.name", String.class.getName()).fromSource(DeprecatedSingleProperty.class).withDeprecation("Don't use this.", "single.name"));
    assertThat(metadata.getItems()).hasSize(3);
}
Also used : ItemDeprecation(org.springframework.boot.configurationprocessor.metadata.ItemDeprecation) ConfigurationMetadata(org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata) ItemMetadata(org.springframework.boot.configurationprocessor.metadata.ItemMetadata) Test(org.junit.Test)

Aggregations

ItemDeprecation (org.springframework.boot.configurationprocessor.metadata.ItemDeprecation)6 Test (org.junit.Test)3 ConfigurationMetadata (org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata)3 ItemMetadata (org.springframework.boot.configurationprocessor.metadata.ItemMetadata)3 File (java.io.File)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 AnnotationMirror (javax.lang.model.element.AnnotationMirror)1 Element (javax.lang.model.element.Element)1 ExecutableElement (javax.lang.model.element.ExecutableElement)1 TypeElement (javax.lang.model.element.TypeElement)1 VariableElement (javax.lang.model.element.VariableElement)1 TypeMirror (javax.lang.model.type.TypeMirror)1 JSONArray (org.json.JSONArray)1 JSONObject (org.json.JSONObject)1