Rename @ImportConfigurationPropertiesBean
Rename `@ImportConfigurationPropertiesBean` to `@ConfigurationPropertiesImport`. Closes gh-23172
This commit is contained in:
@@ -20,8 +20,8 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata;
|
||||
import org.springframework.boot.configurationprocessor.metadata.Metadata;
|
||||
import org.springframework.boot.configurationsample.ImportConfigurationPropertiesBean;
|
||||
import org.springframework.boot.configurationsample.ImportConfigurationPropertiesBeans;
|
||||
import org.springframework.boot.configurationsample.ConfigurationPropertiesImport;
|
||||
import org.springframework.boot.configurationsample.ConfigurationPropertiesImports;
|
||||
import org.springframework.boot.configurationsample.importbean.ImportJavaBeanConfigurationPropertiesBean;
|
||||
import org.springframework.boot.configurationsample.importbean.ImportMultipleTypeConfigurationPropertiesBean;
|
||||
import org.springframework.boot.configurationsample.importbean.ImportRepeatedConfigurationPropertiesBean;
|
||||
@@ -32,8 +32,8 @@ import org.springframework.boot.configurationsample.importbean.ImportedValueObje
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link ImportConfigurationPropertiesBean} and
|
||||
* {@link ImportConfigurationPropertiesBeans}.
|
||||
* Tests for {@link ConfigurationPropertiesImport} and
|
||||
* {@link ConfigurationPropertiesImports}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
|
||||
@@ -40,8 +40,8 @@ class MetadataGenerationEnvironmentFactory implements Function<ProcessingEnviron
|
||||
TestConfigurationMetadataAnnotationProcessor.ENDPOINT_ANNOTATION,
|
||||
TestConfigurationMetadataAnnotationProcessor.READ_OPERATION_ANNOTATION,
|
||||
TestConfigurationMetadataAnnotationProcessor.NAME_ANNOTATION,
|
||||
TestConfigurationMetadataAnnotationProcessor.IMPORT_CONFIGURATION_PROPERTIES_BEAN_ANNOATION,
|
||||
TestConfigurationMetadataAnnotationProcessor.IMPORT_CONFIGURATION_PROPERTIES_BEANS_ANNOATION);
|
||||
TestConfigurationMetadataAnnotationProcessor.CONFIGURATION_PROPERTIES_IMPORT_ANNOATION,
|
||||
TestConfigurationMetadataAnnotationProcessor.CONFIGURATION_PROPERTIES_IMPORTS_ANNOATION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ public class TestConfigurationMetadataAnnotationProcessor extends ConfigurationM
|
||||
|
||||
public static final String NAME_ANNOTATION = "org.springframework.boot.configurationsample.Name";
|
||||
|
||||
public static final String IMPORT_CONFIGURATION_PROPERTIES_BEAN_ANNOATION = "org.springframework.boot.configurationsample.ImportConfigurationPropertiesBean";
|
||||
public static final String CONFIGURATION_PROPERTIES_IMPORT_ANNOATION = "org.springframework.boot.configurationsample.ConfigurationPropertiesImport";
|
||||
|
||||
public static final String IMPORT_CONFIGURATION_PROPERTIES_BEANS_ANNOATION = "org.springframework.boot.configurationsample.ImportConfigurationPropertiesBeans";
|
||||
public static final String CONFIGURATION_PROPERTIES_IMPORTS_ANNOATION = "org.springframework.boot.configurationsample.ConfigurationPropertiesImports";
|
||||
|
||||
private ConfigurationMetadata metadata;
|
||||
|
||||
@@ -110,13 +110,13 @@ public class TestConfigurationMetadataAnnotationProcessor extends ConfigurationM
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String importConfigurationPropertiesBeanAnnotation() {
|
||||
return IMPORT_CONFIGURATION_PROPERTIES_BEAN_ANNOATION;
|
||||
protected String configurationPropertiesImportAnnotation() {
|
||||
return CONFIGURATION_PROPERTIES_IMPORT_ANNOATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String importConfigurationPropertiesBeansAnnotation() {
|
||||
return IMPORT_CONFIGURATION_PROPERTIES_BEANS_ANNOATION;
|
||||
protected String configurationPropertiesImportsAnnotation() {
|
||||
return CONFIGURATION_PROPERTIES_IMPORTS_ANNOATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.lang.annotation.Target;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
|
||||
/**
|
||||
* Alternative to Spring Boot's {@code ImportConfigurationPropertiesBean} for testing
|
||||
* (removes the need for a dependency on the real annotation).
|
||||
* Alternative to Spring Boot's {@code ConfigurationPropertiesImport} for testing (removes
|
||||
* the need for a dependency on the real annotation).
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@@ -35,8 +35,8 @@ import org.springframework.core.annotation.AliasFor;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@ConfigurationProperties
|
||||
@Repeatable(ImportConfigurationPropertiesBeans.class)
|
||||
public @interface ImportConfigurationPropertiesBean {
|
||||
@Repeatable(ConfigurationPropertiesImports.class)
|
||||
public @interface ConfigurationPropertiesImport {
|
||||
|
||||
Class<?>[] type();
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Alternative to Spring Boot's {@code ImportConfigurationPropertiesBeans} for testing
|
||||
* Alternative to Spring Boot's {@code ConfigurationPropertiesImports} for testing
|
||||
* (removes the need for a dependency on the real annotation).
|
||||
*
|
||||
* @author Phillip Webb
|
||||
@@ -31,8 +31,8 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ImportConfigurationPropertiesBeans {
|
||||
public @interface ConfigurationPropertiesImports {
|
||||
|
||||
ImportConfigurationPropertiesBean[] value();
|
||||
ConfigurationPropertiesImport[] value();
|
||||
|
||||
}
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.importbean;
|
||||
|
||||
import org.springframework.boot.configurationsample.ImportConfigurationPropertiesBean;
|
||||
import org.springframework.boot.configurationsample.ConfigurationPropertiesImport;
|
||||
|
||||
/**
|
||||
* An import of a java bean.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ImportConfigurationPropertiesBean(type = ImportedJavaBean.class, prefix = "importbean")
|
||||
@ConfigurationPropertiesImport(type = ImportedJavaBean.class, prefix = "importbean")
|
||||
public class ImportJavaBeanConfigurationPropertiesBean {
|
||||
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.importbean;
|
||||
|
||||
import org.springframework.boot.configurationsample.ImportConfigurationPropertiesBean;
|
||||
import org.springframework.boot.configurationsample.ConfigurationPropertiesImport;
|
||||
|
||||
/**
|
||||
* An import of a java bean and a value object.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ImportConfigurationPropertiesBean(type = { ImportedJavaBean.class, ImportedValueObject.class }, prefix = "importbean")
|
||||
@ConfigurationPropertiesImport(type = { ImportedJavaBean.class, ImportedValueObject.class }, prefix = "importbean")
|
||||
public class ImportMultipleTypeConfigurationPropertiesBean {
|
||||
|
||||
}
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.importbean;
|
||||
|
||||
import org.springframework.boot.configurationsample.ImportConfigurationPropertiesBean;
|
||||
import org.springframework.boot.configurationsample.ConfigurationPropertiesImport;
|
||||
|
||||
/**
|
||||
* An import of a java bean and a value object.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ImportConfigurationPropertiesBean(type = ImportedJavaBean.class, prefix = "jb")
|
||||
@ImportConfigurationPropertiesBean(type = ImportedValueObject.class, prefix = "vo")
|
||||
@ConfigurationPropertiesImport(type = ImportedJavaBean.class, prefix = "jb")
|
||||
@ConfigurationPropertiesImport(type = ImportedValueObject.class, prefix = "vo")
|
||||
public class ImportRepeatedConfigurationPropertiesBean {
|
||||
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.importbean;
|
||||
|
||||
import org.springframework.boot.configurationsample.ImportConfigurationPropertiesBean;
|
||||
import org.springframework.boot.configurationsample.ConfigurationPropertiesImport;
|
||||
|
||||
/**
|
||||
* An import of a value object.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ImportConfigurationPropertiesBean(type = ImportedValueObject.class, prefix = "importbean")
|
||||
@ConfigurationPropertiesImport(type = ImportedValueObject.class, prefix = "importbean")
|
||||
public class ImportValueObjectConfigurationPropertiesBean {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user