mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '3.5.x'
Closes gh-47480
This commit is contained in:
+6
-6
@@ -521,7 +521,7 @@ class ConfigurationMetadataAnnotationProcessorTests extends AbstractMetadataGene
|
||||
@Test
|
||||
void recordProperties() {
|
||||
String source = """
|
||||
@org.springframework.boot.configurationsample.ConfigurationProperties("implicit")
|
||||
@org.springframework.boot.configurationsample.TestConfigurationProperties("implicit")
|
||||
public record ExampleRecord(String someString, Integer someInteger) {
|
||||
}
|
||||
""";
|
||||
@@ -533,10 +533,10 @@ class ConfigurationMetadataAnnotationProcessorTests extends AbstractMetadataGene
|
||||
@Test
|
||||
void recordPropertiesWithDefaultValues() {
|
||||
String source = """
|
||||
@org.springframework.boot.configurationsample.ConfigurationProperties("record.defaults")
|
||||
@org.springframework.boot.configurationsample.TestConfigurationProperties("record.defaults")
|
||||
public record ExampleRecord(
|
||||
@org.springframework.boot.configurationsample.DefaultValue("An1s9n") String someString,
|
||||
@org.springframework.boot.configurationsample.DefaultValue("594") Integer someInteger) {
|
||||
@org.springframework.boot.configurationsample.TestDefaultValue("An1s9n") String someString,
|
||||
@org.springframework.boot.configurationsample.TestDefaultValue("594") Integer someInteger) {
|
||||
}
|
||||
""";
|
||||
ConfigurationMetadata metadata = compile(source);
|
||||
@@ -549,9 +549,9 @@ class ConfigurationMetadataAnnotationProcessorTests extends AbstractMetadataGene
|
||||
@Test
|
||||
void multiConstructorRecordProperties() {
|
||||
String source = """
|
||||
@org.springframework.boot.configurationsample.ConfigurationProperties("multi")
|
||||
@org.springframework.boot.configurationsample.TestConfigurationProperties("multi")
|
||||
public record ExampleRecord(String someString, Integer someInteger) {
|
||||
@org.springframework.boot.configurationsample.ConstructorBinding
|
||||
@org.springframework.boot.configurationsample.TestConstructorBinding
|
||||
public ExampleRecord(String someString) {
|
||||
this(someString, 42);
|
||||
}
|
||||
|
||||
+22
-21
@@ -23,7 +23,7 @@ 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.Access;
|
||||
import org.springframework.boot.configurationsample.TestAccess;
|
||||
import org.springframework.boot.configurationsample.endpoint.CamelCaseEndpoint;
|
||||
import org.springframework.boot.configurationsample.endpoint.CustomPropertiesEndpoint;
|
||||
import org.springframework.boot.configurationsample.endpoint.EnabledEndpoint;
|
||||
@@ -54,7 +54,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
void simpleEndpoint() {
|
||||
ConfigurationMetadata metadata = compile(SimpleEndpoint.class);
|
||||
assertThat(metadata).has(Metadata.withGroup("management.endpoint.simple").fromSource(SimpleEndpoint.class));
|
||||
assertThat(metadata).has(access("simple", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(access("simple", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata).has(cacheTtl("simple"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
void enabledEndpoint() {
|
||||
ConfigurationMetadata metadata = compile(EnabledEndpoint.class);
|
||||
assertThat(metadata).has(Metadata.withGroup("management.endpoint.enabled").fromSource(EnabledEndpoint.class));
|
||||
assertThat(metadata).has(access("enabled", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(access("enabled", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata.getItems()).hasSize(2);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
void noAccessEndpoint() {
|
||||
ConfigurationMetadata metadata = compile(NoAccessEndpoint.class);
|
||||
assertThat(metadata).has(Metadata.withGroup("management.endpoint.noaccess").fromSource(NoAccessEndpoint.class));
|
||||
assertThat(metadata).has(access("noaccess", Access.NONE));
|
||||
assertThat(metadata).has(access("noaccess", TestAccess.NONE));
|
||||
assertThat(metadata.getItems()).hasSize(2);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
ConfigurationMetadata metadata = compile(ReadOnlyAccessEndpoint.class);
|
||||
assertThat(metadata)
|
||||
.has(Metadata.withGroup("management.endpoint.readonlyaccess").fromSource(ReadOnlyAccessEndpoint.class));
|
||||
assertThat(metadata).has(access("readonlyaccess", Access.READ_ONLY));
|
||||
assertThat(metadata).has(access("readonlyaccess", TestAccess.READ_ONLY));
|
||||
assertThat(metadata.getItems()).hasSize(2);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
ConfigurationMetadata metadata = compile(UnrestrictedAccessEndpoint.class);
|
||||
assertThat(metadata).has(Metadata.withGroup("management.endpoint.unrestrictedaccess")
|
||||
.fromSource(UnrestrictedAccessEndpoint.class));
|
||||
assertThat(metadata).has(access("unrestrictedaccess", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(access("unrestrictedaccess", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata.getItems()).hasSize(2);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
assertThat(metadata).has(Metadata.withProperty("management.endpoint.customprops.name")
|
||||
.ofType(String.class)
|
||||
.withDefaultValue("test"));
|
||||
assertThat(metadata).has(access("customprops", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(access("customprops", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata).has(cacheTtl("customprops"));
|
||||
assertThat(metadata.getItems()).hasSize(4);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
void specificEndpoint() {
|
||||
ConfigurationMetadata metadata = compile(SpecificEndpoint.class);
|
||||
assertThat(metadata).has(Metadata.withGroup("management.endpoint.specific").fromSource(SpecificEndpoint.class));
|
||||
assertThat(metadata).has(access("specific", Access.READ_ONLY));
|
||||
assertThat(metadata).has(access("specific", TestAccess.READ_ONLY));
|
||||
assertThat(metadata).has(cacheTtl("specific"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
ConfigurationMetadata metadata = compile(CamelCaseEndpoint.class);
|
||||
assertThat(metadata)
|
||||
.has(Metadata.withGroup("management.endpoint.pascal-case").fromSource(CamelCaseEndpoint.class));
|
||||
assertThat(metadata).has(defaultAccess("PascalCase", "pascal-case", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(defaultAccess("PascalCase", "pascal-case", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata.getItems()).hasSize(2);
|
||||
}
|
||||
|
||||
@@ -130,15 +130,15 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
ConfigurationMetadata metadata = project.compile();
|
||||
assertThat(metadata)
|
||||
.has(Metadata.withGroup("management.endpoint.incremental").fromSource(IncrementalEndpoint.class));
|
||||
assertThat(metadata).has(access("incremental", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(access("incremental", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata).has(cacheTtl("incremental"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
project.replaceText(IncrementalEndpoint.class, "id = \"incremental\"",
|
||||
"id = \"incremental\", defaultAccess = org.springframework.boot.configurationsample.Access.NONE");
|
||||
"id = \"incremental\", defaultAccess = org.springframework.boot.configurationsample.TestAccess.NONE");
|
||||
metadata = project.compile();
|
||||
assertThat(metadata)
|
||||
.has(Metadata.withGroup("management.endpoint.incremental").fromSource(IncrementalEndpoint.class));
|
||||
assertThat(metadata).has(access("incremental", Access.NONE));
|
||||
assertThat(metadata).has(access("incremental", TestAccess.NONE));
|
||||
assertThat(metadata).has(cacheTtl("incremental"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
}
|
||||
@@ -149,14 +149,14 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
ConfigurationMetadata metadata = project.compile();
|
||||
assertThat(metadata)
|
||||
.has(Metadata.withGroup("management.endpoint.incremental").fromSource(IncrementalEndpoint.class));
|
||||
assertThat(metadata).has(access("incremental", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(access("incremental", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata).has(cacheTtl("incremental"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
project.replaceText(IncrementalEndpoint.class, "@Nullable String param", "String param");
|
||||
metadata = project.compile();
|
||||
assertThat(metadata)
|
||||
.has(Metadata.withGroup("management.endpoint.incremental").fromSource(IncrementalEndpoint.class));
|
||||
assertThat(metadata).has(access("incremental", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(access("incremental", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata.getItems()).hasSize(2);
|
||||
}
|
||||
|
||||
@@ -165,13 +165,14 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
TestProject project = new TestProject(SpecificEndpoint.class);
|
||||
ConfigurationMetadata metadata = project.compile();
|
||||
assertThat(metadata).has(Metadata.withGroup("management.endpoint.specific").fromSource(SpecificEndpoint.class));
|
||||
assertThat(metadata).has(access("specific", Access.READ_ONLY));
|
||||
assertThat(metadata).has(access("specific", TestAccess.READ_ONLY));
|
||||
assertThat(metadata).has(cacheTtl("specific"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
project.replaceText(SpecificEndpoint.class, "defaultAccess = Access.READ_ONLY", "defaultAccess = Access.NONE");
|
||||
project.replaceText(SpecificEndpoint.class, "defaultAccess = TestAccess.READ_ONLY",
|
||||
"defaultAccess = TestAccess.NONE");
|
||||
metadata = project.compile();
|
||||
assertThat(metadata).has(Metadata.withGroup("management.endpoint.specific").fromSource(SpecificEndpoint.class));
|
||||
assertThat(metadata).has(access("specific", Access.NONE));
|
||||
assertThat(metadata).has(access("specific", TestAccess.NONE));
|
||||
assertThat(metadata).has(cacheTtl("specific"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
}
|
||||
@@ -180,7 +181,7 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
void shouldTolerateEndpointWithSameId() {
|
||||
ConfigurationMetadata metadata = compile(SimpleEndpoint.class, SimpleEndpoint2.class);
|
||||
assertThat(metadata).has(Metadata.withGroup("management.endpoint.simple").fromSource(SimpleEndpoint.class));
|
||||
assertThat(metadata).has(defaultAccess("simple", "simple", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(defaultAccess("simple", "simple", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata).has(cacheTtl("simple"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
}
|
||||
@@ -199,17 +200,17 @@ class EndpointMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
ConfigurationMetadata metadata = compile(NullableParameterEndpoint.class);
|
||||
assertThat(metadata)
|
||||
.has(Metadata.withGroup("management.endpoint.nullable").fromSource(NullableParameterEndpoint.class));
|
||||
assertThat(metadata).has(access("nullable", Access.UNRESTRICTED));
|
||||
assertThat(metadata).has(access("nullable", TestAccess.UNRESTRICTED));
|
||||
assertThat(metadata).has(cacheTtl("nullable"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
}
|
||||
|
||||
private Metadata.MetadataItemCondition access(String endpointId, Access defaultValue) {
|
||||
private Metadata.MetadataItemCondition access(String endpointId, TestAccess defaultValue) {
|
||||
return defaultAccess(endpointId, endpointId, defaultValue);
|
||||
}
|
||||
|
||||
private Metadata.MetadataItemCondition defaultAccess(String endpointId, String endpointSuffix,
|
||||
Access defaultValue) {
|
||||
TestAccess defaultValue) {
|
||||
return Metadata.withAccess("management.endpoint." + endpointSuffix + ".access")
|
||||
.withDefaultValue(defaultValue.name().toLowerCase(Locale.ENGLISH))
|
||||
.withDescription("Permitted level of access for the %s endpoint.".formatted(endpointId));
|
||||
|
||||
+2
-2
@@ -66,8 +66,8 @@ class IncrementalBuildMetadataGenerationTests extends AbstractMetadataGeneration
|
||||
ConfigurationMetadata metadata = project.compile();
|
||||
assertThat(metadata).has(Metadata.withProperty("foo.counter").withDefaultValue(0));
|
||||
assertThat(metadata).has(Metadata.withProperty("bar.counter").withDefaultValue(0));
|
||||
project.replaceText(BarProperties.class, "@ConfigurationProperties", "//@ConfigurationProperties");
|
||||
project.replaceText(FooProperties.class, "@ConfigurationProperties", "//@ConfigurationProperties");
|
||||
project.replaceText(BarProperties.class, "@TestConfigurationProperties", "//@TestConfigurationProperties");
|
||||
project.replaceText(FooProperties.class, "@TestConfigurationProperties", "//@TestConfigurationProperties");
|
||||
metadata = project.compile();
|
||||
assertThat(metadata).isNull();
|
||||
}
|
||||
|
||||
+4
-4
@@ -29,8 +29,8 @@ import org.springframework.boot.configurationprocessor.metadata.ConfigurationMet
|
||||
import org.springframework.boot.configurationprocessor.metadata.JsonMarshaller;
|
||||
import org.springframework.boot.configurationprocessor.test.CompiledMetadataReader;
|
||||
import org.springframework.boot.configurationprocessor.test.TestConfigurationMetadataAnnotationProcessor;
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestNestedConfigurationProperty;
|
||||
import org.springframework.core.test.tools.ResourceFile;
|
||||
import org.springframework.core.test.tools.SourceFile;
|
||||
import org.springframework.core.test.tools.SourceFiles;
|
||||
@@ -50,8 +50,8 @@ import org.springframework.util.FileCopyUtils;
|
||||
*/
|
||||
public class TestProject {
|
||||
|
||||
private static final Class<?>[] ALWAYS_INCLUDE = { ConfigurationProperties.class,
|
||||
NestedConfigurationProperty.class };
|
||||
private static final Class<?>[] ALWAYS_INCLUDE = { TestConfigurationProperties.class,
|
||||
TestNestedConfigurationProperty.class };
|
||||
|
||||
private SourceFiles sources;
|
||||
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ public abstract class AbstractFieldValuesProcessorTests {
|
||||
assertThat(values.get("memberSelectInt")).isNull();
|
||||
}
|
||||
|
||||
@SupportedAnnotationTypes({ "org.springframework.boot.configurationsample.ConfigurationProperties" })
|
||||
@SupportedAnnotationTypes({ "org.springframework.boot.configurationsample.TestConfigurationProperties" })
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
private final class TestProcessor extends AbstractProcessor {
|
||||
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ import org.assertj.core.api.Condition;
|
||||
import org.hamcrest.collection.IsMapContaining;
|
||||
|
||||
import org.springframework.boot.configurationprocessor.metadata.ItemMetadata.ItemType;
|
||||
import org.springframework.boot.configurationsample.Access;
|
||||
import org.springframework.boot.configurationsample.TestAccess;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public final class Metadata {
|
||||
}
|
||||
|
||||
public static Metadata.MetadataItemCondition withAccess(String key) {
|
||||
return withProperty(key).ofType(Access.class);
|
||||
return withProperty(key).ofType(TestAccess.class);
|
||||
}
|
||||
|
||||
public static MetadataHintCondition withHint(String name) {
|
||||
|
||||
+16
-16
@@ -47,37 +47,37 @@ import org.springframework.boot.configurationprocessor.ConfigurationMetadataAnno
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
public class TestConfigurationMetadataAnnotationProcessor extends ConfigurationMetadataAnnotationProcessor {
|
||||
|
||||
public static final String CONFIGURATION_PROPERTIES_ANNOTATION = "org.springframework.boot.configurationsample.ConfigurationProperties";
|
||||
public static final String CONFIGURATION_PROPERTIES_ANNOTATION = "org.springframework.boot.configurationsample.TestConfigurationProperties";
|
||||
|
||||
public static final String CONFIGURATION_PROPERTIES_SOURCE_ANNOTATION = "org.springframework.boot.configurationsample.ConfigurationPropertiesSource";
|
||||
public static final String CONFIGURATION_PROPERTIES_SOURCE_ANNOTATION = "org.springframework.boot.configurationsample.TestConfigurationPropertiesSource";
|
||||
|
||||
public static final String NESTED_CONFIGURATION_PROPERTY_ANNOTATION = "org.springframework.boot.configurationsample.NestedConfigurationProperty";
|
||||
public static final String NESTED_CONFIGURATION_PROPERTY_ANNOTATION = "org.springframework.boot.configurationsample.TestNestedConfigurationProperty";
|
||||
|
||||
public static final String DEPRECATED_CONFIGURATION_PROPERTY_ANNOTATION = "org.springframework.boot.configurationsample.DeprecatedConfigurationProperty";
|
||||
public static final String DEPRECATED_CONFIGURATION_PROPERTY_ANNOTATION = "org.springframework.boot.configurationsample.TestDeprecatedConfigurationProperty";
|
||||
|
||||
public static final String CONSTRUCTOR_BINDING_ANNOTATION = "org.springframework.boot.configurationsample.ConstructorBinding";
|
||||
public static final String CONSTRUCTOR_BINDING_ANNOTATION = "org.springframework.boot.configurationsample.TestConstructorBinding";
|
||||
|
||||
public static final String AUTOWIRED_ANNOTATION = "org.springframework.boot.configurationsample.Autowired";
|
||||
public static final String AUTOWIRED_ANNOTATION = "org.springframework.boot.configurationsample.TestAutowired";
|
||||
|
||||
public static final String DEFAULT_VALUE_ANNOTATION = "org.springframework.boot.configurationsample.DefaultValue";
|
||||
public static final String DEFAULT_VALUE_ANNOTATION = "org.springframework.boot.configurationsample.TestDefaultValue";
|
||||
|
||||
public static final String CONTROLLER_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.ControllerEndpoint";
|
||||
public static final String CONTROLLER_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.TestControllerEndpoint";
|
||||
|
||||
public static final String ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.Endpoint";
|
||||
public static final String ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.TestEndpoint";
|
||||
|
||||
public static final String JMX_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.JmxEndpoint";
|
||||
public static final String JMX_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.TestJmxEndpoint";
|
||||
|
||||
public static final String REST_CONTROLLER_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.RestControllerEndpoint";
|
||||
public static final String REST_CONTROLLER_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.TestRestControllerEndpoint";
|
||||
|
||||
public static final String SERVLET_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.ServletEndpoint";
|
||||
public static final String SERVLET_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.TestServletEndpoint";
|
||||
|
||||
public static final String WEB_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.WebEndpoint";
|
||||
public static final String WEB_ENDPOINT_ANNOTATION = "org.springframework.boot.configurationsample.TestWebEndpoint";
|
||||
|
||||
public static final String READ_OPERATION_ANNOTATION = "org.springframework.boot.configurationsample.ReadOperation";
|
||||
public static final String READ_OPERATION_ANNOTATION = "org.springframework.boot.configurationsample.TestReadOperation";
|
||||
|
||||
public static final String NAME_ANNOTATION = "org.springframework.boot.configurationsample.Name";
|
||||
public static final String NAME_ANNOTATION = "org.springframework.boot.configurationsample.TestName";
|
||||
|
||||
public static final String ENDPOINT_ACCESS_ENUM = "org.springframework.boot.configurationsample.Access";
|
||||
public static final String ENDPOINT_ACCESS_ENUM = "org.springframework.boot.configurationsample.TestAccess";
|
||||
|
||||
public TestConfigurationMetadataAnnotationProcessor() {
|
||||
}
|
||||
|
||||
+3
-2
@@ -17,11 +17,12 @@
|
||||
package org.springframework.boot.configurationsample;
|
||||
|
||||
/**
|
||||
* Permitted level of access to an endpoint.
|
||||
* Alternative to Spring Boot's {@code @Access} for testing (removes the need for a
|
||||
* dependency on the real annotation).
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
public enum Access {
|
||||
public enum TestAccess {
|
||||
|
||||
NONE,
|
||||
|
||||
+1
-1
@@ -31,6 +31,6 @@ import java.lang.annotation.Target;
|
||||
@Target({ ElementType.TYPE, ElementType.CONSTRUCTOR })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Autowired {
|
||||
public @interface TestAutowired {
|
||||
|
||||
}
|
||||
+1
-1
@@ -32,7 +32,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ConfigurationProperties {
|
||||
public @interface TestConfigurationProperties {
|
||||
|
||||
String value() default "";
|
||||
|
||||
+1
-1
@@ -31,6 +31,6 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ConfigurationPropertiesSource {
|
||||
public @interface TestConfigurationPropertiesSource {
|
||||
|
||||
}
|
||||
+1
-1
@@ -31,6 +31,6 @@ import java.lang.annotation.Target;
|
||||
@Target({ ElementType.CONSTRUCTOR, ElementType.ANNOTATION_TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ConstructorBinding {
|
||||
public @interface TestConstructorBinding {
|
||||
|
||||
}
|
||||
+2
-2
@@ -31,13 +31,13 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ControllerEndpoint {
|
||||
public @interface TestControllerEndpoint {
|
||||
|
||||
String id() default "";
|
||||
|
||||
@Deprecated
|
||||
boolean enableByDefault() default true;
|
||||
|
||||
Access defaultAccess() default Access.UNRESTRICTED;
|
||||
TestAccess defaultAccess() default TestAccess.UNRESTRICTED;
|
||||
|
||||
}
|
||||
+1
-1
@@ -32,7 +32,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ ElementType.PARAMETER })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface DefaultValue {
|
||||
public @interface TestDefaultValue {
|
||||
|
||||
String[] value() default {};
|
||||
|
||||
+3
-8
@@ -23,20 +23,15 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Indicates that a getter in a {@link ConfigurationProperties @ConfigurationProperties}
|
||||
* object is deprecated. This annotation has no bearing on the actual binding processes,
|
||||
* but it is used by the {@code spring-boot-configuration-processor} to add deprecation
|
||||
* meta-data.
|
||||
* <p>
|
||||
* This annotation <strong>must</strong> be used on the getter of the deprecated element.
|
||||
* Alternative to Spring Boot's {@code @DeprecatedConfigurationProperty} for testing
|
||||
* (removes the need for a dependency on the real annotation).
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 1.3.0
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface DeprecatedConfigurationProperty {
|
||||
public @interface TestDeprecatedConfigurationProperty {
|
||||
|
||||
/**
|
||||
* The reason for the deprecation.
|
||||
+2
-2
@@ -31,10 +31,10 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Endpoint {
|
||||
public @interface TestEndpoint {
|
||||
|
||||
String id() default "";
|
||||
|
||||
Access defaultAccess() default Access.UNRESTRICTED;
|
||||
TestAccess defaultAccess() default TestAccess.UNRESTRICTED;
|
||||
|
||||
}
|
||||
+2
-2
@@ -31,10 +31,10 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface JmxEndpoint {
|
||||
public @interface TestJmxEndpoint {
|
||||
|
||||
String id() default "";
|
||||
|
||||
Access defaultAccess() default Access.UNRESTRICTED;
|
||||
TestAccess defaultAccess() default TestAccess.UNRESTRICTED;
|
||||
|
||||
}
|
||||
+1
-1
@@ -31,7 +31,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ ElementType.PARAMETER, ElementType.FIELD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Name {
|
||||
public @interface TestName {
|
||||
|
||||
String value();
|
||||
|
||||
+1
-1
@@ -33,6 +33,6 @@ import java.lang.annotation.Target;
|
||||
@Target({ ElementType.FIELD, ElementType.RECORD_COMPONENT, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface NestedConfigurationProperty {
|
||||
public @interface TestNestedConfigurationProperty {
|
||||
|
||||
}
|
||||
+1
-1
@@ -31,7 +31,7 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ReadOperation {
|
||||
public @interface TestReadOperation {
|
||||
|
||||
String[] produces() default {};
|
||||
|
||||
+2
-2
@@ -31,10 +31,10 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface RestControllerEndpoint {
|
||||
public @interface TestRestControllerEndpoint {
|
||||
|
||||
String id() default "";
|
||||
|
||||
Access defaultAccess() default Access.UNRESTRICTED;
|
||||
TestAccess defaultAccess() default TestAccess.UNRESTRICTED;
|
||||
|
||||
}
|
||||
+2
-2
@@ -31,10 +31,10 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ServletEndpoint {
|
||||
public @interface TestServletEndpoint {
|
||||
|
||||
String id() default "";
|
||||
|
||||
Access defaultAccess() default Access.UNRESTRICTED;
|
||||
TestAccess defaultAccess() default TestAccess.UNRESTRICTED;
|
||||
|
||||
}
|
||||
+2
-2
@@ -31,10 +31,10 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface WebEndpoint {
|
||||
public @interface TestWebEndpoint {
|
||||
|
||||
String id() default "";
|
||||
|
||||
Access defaultAccess() default Access.UNRESTRICTED;
|
||||
TestAccess defaultAccess() default TestAccess.UNRESTRICTED;
|
||||
|
||||
}
|
||||
+2
-2
@@ -18,7 +18,7 @@ package org.springframework.boot.configurationsample.deprecation;
|
||||
|
||||
import org.apache.commons.dbcp2.BasicDataSource;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Test configuration for DBCP2 {@link BasicDataSource}.
|
||||
@@ -27,7 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
public class Dbcp2Configuration {
|
||||
|
||||
@ConfigurationProperties("spring.datasource.dbcp2")
|
||||
@TestConfigurationProperties("spring.datasource.dbcp2")
|
||||
BasicDataSource basicDataSource() {
|
||||
return new BasicDataSource();
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
|
||||
/**
|
||||
* An endpoint with an upper camel case id.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Endpoint(id = "PascalCase")
|
||||
@TestEndpoint(id = "PascalCase")
|
||||
public class CamelCaseEndpoint {
|
||||
|
||||
}
|
||||
|
||||
+6
-6
@@ -16,22 +16,22 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.ReadOperation;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestReadOperation;
|
||||
|
||||
/**
|
||||
* An endpoint with additional custom properties.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Endpoint(id = "customprops")
|
||||
@ConfigurationProperties("management.endpoint.customprops")
|
||||
@TestEndpoint(id = "customprops")
|
||||
@TestConfigurationProperties("management.endpoint.customprops")
|
||||
public class CustomPropertiesEndpoint {
|
||||
|
||||
private String name = "test";
|
||||
|
||||
@ReadOperation
|
||||
@TestReadOperation
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
+4
-4
@@ -16,22 +16,22 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.ReadOperation;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestReadOperation;
|
||||
|
||||
/**
|
||||
* An endpoint that is enabled unless configured explicitly.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Endpoint(id = "enabled")
|
||||
@TestEndpoint(id = "enabled")
|
||||
public class EnabledEndpoint {
|
||||
|
||||
public String someMethod() {
|
||||
return "not a read operation";
|
||||
}
|
||||
|
||||
@ReadOperation
|
||||
@TestReadOperation
|
||||
public String retrieve(String parameter, Integer anotherParameter) {
|
||||
return "not a main read operation";
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,15 +16,15 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.Access;
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.TestAccess;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
|
||||
/**
|
||||
* An endpoint with no permitted access unless configured explicitly.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
@Endpoint(id = "noaccess", defaultAccess = Access.NONE)
|
||||
@TestEndpoint(id = "noaccess", defaultAccess = TestAccess.NONE)
|
||||
public class NoAccessEndpoint {
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -18,18 +18,18 @@ package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.ReadOperation;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestReadOperation;
|
||||
|
||||
/**
|
||||
* An endpoint that uses {@code Nullable} to signal an optional parameter.
|
||||
*
|
||||
* @author Wonyong Hwang
|
||||
*/
|
||||
@Endpoint(id = "nullable")
|
||||
@TestEndpoint(id = "nullable")
|
||||
public class NullableParameterEndpoint {
|
||||
|
||||
@ReadOperation
|
||||
@TestReadOperation
|
||||
public String invoke(@Nullable String parameter) {
|
||||
return "test with " + parameter;
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,15 +16,15 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.Access;
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.TestAccess;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
|
||||
/**
|
||||
* An endpoint with read-only access unless configured explicitly.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
@Endpoint(id = "readonlyaccess", defaultAccess = Access.READ_ONLY)
|
||||
@TestEndpoint(id = "readonlyaccess", defaultAccess = TestAccess.READ_ONLY)
|
||||
public class ReadOnlyAccessEndpoint {
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -16,18 +16,18 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.ReadOperation;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestReadOperation;
|
||||
|
||||
/**
|
||||
* A simple endpoint with no default override.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Endpoint(id = "simple")
|
||||
@TestEndpoint(id = "simple")
|
||||
public class SimpleEndpoint {
|
||||
|
||||
@ReadOperation
|
||||
@TestReadOperation
|
||||
public String invoke() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
+4
-4
@@ -16,18 +16,18 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.ReadOperation;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestReadOperation;
|
||||
|
||||
/**
|
||||
* A simple endpoint with no default override, with the same id as {@link SimpleEndpoint}.
|
||||
*
|
||||
* @author Moritz Halbritter
|
||||
*/
|
||||
@Endpoint(id = "simple")
|
||||
@TestEndpoint(id = "simple")
|
||||
public class SimpleEndpoint2 {
|
||||
|
||||
@ReadOperation
|
||||
@TestReadOperation
|
||||
public String invoke() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
+5
-5
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.Access;
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.ReadOperation;
|
||||
import org.springframework.boot.configurationsample.TestAccess;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestReadOperation;
|
||||
|
||||
/**
|
||||
* A simple endpoint with no default override, with the same id as {@link SimpleEndpoint},
|
||||
@@ -26,10 +26,10 @@ import org.springframework.boot.configurationsample.ReadOperation;
|
||||
*
|
||||
* @author Moritz Halbritter
|
||||
*/
|
||||
@Endpoint(id = "simple", defaultAccess = Access.NONE)
|
||||
@TestEndpoint(id = "simple", defaultAccess = TestAccess.NONE)
|
||||
public class SimpleEndpoint3 {
|
||||
|
||||
@ReadOperation
|
||||
@TestReadOperation
|
||||
public String invoke() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
+5
-5
@@ -18,9 +18,9 @@ package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.configurationsample.Access;
|
||||
import org.springframework.boot.configurationsample.ReadOperation;
|
||||
import org.springframework.boot.configurationsample.WebEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestAccess;
|
||||
import org.springframework.boot.configurationsample.TestReadOperation;
|
||||
import org.springframework.boot.configurationsample.TestWebEndpoint;
|
||||
|
||||
/**
|
||||
* A meta-annotated endpoint. Also with a package private read operation that has an
|
||||
@@ -28,10 +28,10 @@ import org.springframework.boot.configurationsample.WebEndpoint;
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@WebEndpoint(id = "specific", defaultAccess = Access.READ_ONLY)
|
||||
@TestWebEndpoint(id = "specific", defaultAccess = TestAccess.READ_ONLY)
|
||||
public class SpecificEndpoint {
|
||||
|
||||
@ReadOperation
|
||||
@TestReadOperation
|
||||
String invoke(@Nullable String param) {
|
||||
return "test";
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint;
|
||||
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
|
||||
/**
|
||||
* An endpoint with unrestricted access unless configured explicitly.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
@Endpoint(id = "unrestrictedaccess")
|
||||
@TestEndpoint(id = "unrestrictedaccess")
|
||||
public class UnrestrictedAccessEndpoint {
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -18,18 +18,18 @@ package org.springframework.boot.configurationsample.endpoint.incremental;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.configurationsample.Endpoint;
|
||||
import org.springframework.boot.configurationsample.ReadOperation;
|
||||
import org.springframework.boot.configurationsample.TestEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestReadOperation;
|
||||
|
||||
/**
|
||||
* An endpoint that is enabled by default.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Endpoint(id = "incremental")
|
||||
@TestEndpoint(id = "incremental")
|
||||
public class IncrementalEndpoint {
|
||||
|
||||
@ReadOperation
|
||||
@TestReadOperation
|
||||
public String invoke(@Nullable String param) {
|
||||
return "test";
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.endpoint.incremental;
|
||||
|
||||
import org.springframework.boot.configurationsample.JmxEndpoint;
|
||||
import org.springframework.boot.configurationsample.TestJmxEndpoint;
|
||||
|
||||
/**
|
||||
* A meta-annotated endpoint.
|
||||
@@ -24,7 +24,7 @@ import org.springframework.boot.configurationsample.JmxEndpoint;
|
||||
* @author Stephane Nicoll
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
@JmxEndpoint(id = "incremental")
|
||||
@TestJmxEndpoint(id = "incremental")
|
||||
public class IncrementalSpecificEndpoint {
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ import java.time.Duration;
|
||||
import java.time.Period;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.util.MimeType;
|
||||
import org.springframework.util.unit.DataSize;
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.util.unit.DataSize;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@ConfigurationProperties
|
||||
@TestConfigurationProperties
|
||||
public class FieldValues {
|
||||
|
||||
private static final String STRING_CONST = "c";
|
||||
|
||||
+4
-4
@@ -16,18 +16,18 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.generic;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestNestedConfigurationProperty;
|
||||
|
||||
/**
|
||||
* More advanced generic setup.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("generic")
|
||||
@TestConfigurationProperties("generic")
|
||||
public class ComplexGenericProperties {
|
||||
|
||||
@NestedConfigurationProperty
|
||||
@TestNestedConfigurationProperty
|
||||
private final UpperBoundGenericPojo<Test> test = new UpperBoundGenericPojo<>();
|
||||
|
||||
public UpperBoundGenericPojo<Test> getTest() {
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.generic;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Builder pattern with a resolved generic
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("builder")
|
||||
@TestConfigurationProperties("builder")
|
||||
public class ConcreteBuilderProperties extends GenericBuilderProperties<ConcreteBuilderProperties> {
|
||||
|
||||
private String description;
|
||||
|
||||
+5
-5
@@ -19,8 +19,8 @@ package org.springframework.boot.configurationsample.generic;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestNestedConfigurationProperty;
|
||||
|
||||
/**
|
||||
* Demonstrate that only relevant generics are stored in the metadata.
|
||||
@@ -28,7 +28,7 @@ import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
* @param <T> the type of the config
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("generic")
|
||||
@TestConfigurationProperties("generic")
|
||||
public class GenericConfig<T> {
|
||||
|
||||
private final Foo foo = new Foo();
|
||||
@@ -41,7 +41,7 @@ public class GenericConfig<T> {
|
||||
|
||||
private String name;
|
||||
|
||||
@NestedConfigurationProperty
|
||||
@TestNestedConfigurationProperty
|
||||
private final Bar<String> bar = new Bar<>();
|
||||
|
||||
private final Map<String, Bar<Integer>> stringToBar = new HashMap<>();
|
||||
@@ -74,7 +74,7 @@ public class GenericConfig<T> {
|
||||
|
||||
private String name;
|
||||
|
||||
@NestedConfigurationProperty
|
||||
@TestNestedConfigurationProperty
|
||||
private final Biz<String> biz = new Biz<>();
|
||||
|
||||
public String getName() {
|
||||
|
||||
+2
-2
@@ -18,14 +18,14 @@ package org.springframework.boot.configurationsample.generic;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Simple properties with resolved generic information.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("generic")
|
||||
@TestConfigurationProperties("generic")
|
||||
public class SimpleGenericProperties extends AbstractIntermediateGenericProperties<Duration> {
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.generic;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Properties with unresolved generic information.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
* @param <C> mapping value type
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("generic")
|
||||
@TestConfigurationProperties("generic")
|
||||
public class UnresolvedGenericProperties<B extends Number, C> extends AbstractGenericProperties<String, B, C> {
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,14 +19,14 @@ package org.springframework.boot.configurationsample.generic;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Demonstrate properties with a wildcard type.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("wildcard")
|
||||
@TestConfigurationProperties("wildcard")
|
||||
public class WildcardConfig {
|
||||
|
||||
private Map<String, ? extends Number> stringToNumber;
|
||||
|
||||
+4
-4
@@ -16,20 +16,20 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.immutable;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.DefaultValue;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestDefaultValue;
|
||||
|
||||
/**
|
||||
* Inner properties, in immutable format.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ConfigurationProperties("test")
|
||||
@TestConfigurationProperties("test")
|
||||
public class DeducedImmutableClassProperties {
|
||||
|
||||
private final Nested nested;
|
||||
|
||||
public DeducedImmutableClassProperties(@DefaultValue Nested nested) {
|
||||
public DeducedImmutableClassProperties(@TestDefaultValue Nested nested) {
|
||||
this.nested = nested;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ package org.springframework.boot.configurationsample.immutable;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.boot.configurationsample.DefaultValue;
|
||||
import org.springframework.boot.configurationsample.TestDefaultValue;
|
||||
|
||||
/**
|
||||
* Simple immutable properties with collections types and defaults.
|
||||
@@ -35,8 +35,8 @@ public class ImmutableCollectionProperties {
|
||||
|
||||
private final List<Duration> durations;
|
||||
|
||||
public ImmutableCollectionProperties(List<String> names, @DefaultValue({ "true", "false" }) List<Boolean> flags,
|
||||
@DefaultValue({ "10s", "1m", "1h" }) List<Duration> durations) {
|
||||
public ImmutableCollectionProperties(List<String> names, @TestDefaultValue({ "true", "false" }) List<Boolean> flags,
|
||||
@TestDefaultValue({ "10s", "1m", "1h" }) List<Duration> durations) {
|
||||
this.names = names;
|
||||
this.flags = flags;
|
||||
this.durations = durations;
|
||||
|
||||
+4
-4
@@ -16,13 +16,13 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.immutable;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.DefaultValue;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestDefaultValue;
|
||||
|
||||
/**
|
||||
* @author Madhura Bhave
|
||||
*/
|
||||
@ConfigurationProperties("immutable")
|
||||
@TestConfigurationProperties("immutable")
|
||||
public class ImmutableDeducedConstructorBindingProperties {
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ public class ImmutableDeducedConstructorBindingProperties {
|
||||
*/
|
||||
private final boolean flag;
|
||||
|
||||
public ImmutableDeducedConstructorBindingProperties(@DefaultValue("boot") String theName, boolean flag) {
|
||||
public ImmutableDeducedConstructorBindingProperties(@TestDefaultValue("boot") String theName, boolean flag) {
|
||||
this.theName = theName;
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.immutable;
|
||||
|
||||
import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestNestedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.specific.SimplePojo;
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ public class ImmutableInnerClassProperties {
|
||||
|
||||
private Foo second;
|
||||
|
||||
@NestedConfigurationProperty
|
||||
@TestNestedConfigurationProperty
|
||||
private final SimplePojo third;
|
||||
|
||||
private final Fourth fourth;
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.immutable;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConstructorBinding;
|
||||
import org.springframework.boot.configurationsample.TestConstructorBinding;
|
||||
|
||||
/**
|
||||
* Simple immutable properties with several constructors.
|
||||
@@ -37,7 +37,7 @@ public class ImmutableMultiConstructorProperties {
|
||||
this(name, null);
|
||||
}
|
||||
|
||||
@ConstructorBinding
|
||||
@TestConstructorBinding
|
||||
public ImmutableMultiConstructorProperties(String name, String description) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
|
||||
+6
-5
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.immutable;
|
||||
|
||||
import org.springframework.boot.configurationsample.DefaultValue;
|
||||
import org.springframework.boot.configurationsample.TestDefaultValue;
|
||||
|
||||
/**
|
||||
* Simple immutable properties with primitive types and defaults.
|
||||
@@ -42,10 +42,11 @@ public class ImmutablePrimitiveWithDefaultsProperties {
|
||||
|
||||
private final double ratio;
|
||||
|
||||
public ImmutablePrimitiveWithDefaultsProperties(@DefaultValue("true") boolean flag, @DefaultValue("120") byte octet,
|
||||
@DefaultValue("a") char letter, @DefaultValue("1000") short number, @DefaultValue("42") int counter,
|
||||
@DefaultValue("2000") long value, @DefaultValue("0.5") float percentage,
|
||||
@DefaultValue("42.42") double ratio) {
|
||||
public ImmutablePrimitiveWithDefaultsProperties(@TestDefaultValue("true") boolean flag,
|
||||
@TestDefaultValue("120") byte octet, @TestDefaultValue("a") char letter,
|
||||
@TestDefaultValue("1000") short number, @TestDefaultValue("42") int counter,
|
||||
@TestDefaultValue("2000") long value, @TestDefaultValue("0.5") float percentage,
|
||||
@TestDefaultValue("42.42") double ratio) {
|
||||
this.flag = flag;
|
||||
this.octet = octet;
|
||||
this.letter = letter;
|
||||
|
||||
+6
-5
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.immutable;
|
||||
|
||||
import org.springframework.boot.configurationsample.DefaultValue;
|
||||
import org.springframework.boot.configurationsample.TestDefaultValue;
|
||||
|
||||
/**
|
||||
* Simple immutable properties with primitive wrapper types and defaults.
|
||||
@@ -42,10 +42,11 @@ public class ImmutablePrimitiveWrapperWithDefaultsProperties {
|
||||
|
||||
private final Double ratio;
|
||||
|
||||
public ImmutablePrimitiveWrapperWithDefaultsProperties(@DefaultValue("true") Boolean flag,
|
||||
@DefaultValue("120") Byte octet, @DefaultValue("a") Character letter, @DefaultValue("1000") Short number,
|
||||
@DefaultValue("42") Integer counter, @DefaultValue("2000") Long value,
|
||||
@DefaultValue("0.5") Float percentage, @DefaultValue("42.42") Double ratio) {
|
||||
public ImmutablePrimitiveWrapperWithDefaultsProperties(@TestDefaultValue("true") Boolean flag,
|
||||
@TestDefaultValue("120") Byte octet, @TestDefaultValue("a") Character letter,
|
||||
@TestDefaultValue("1000") Short number, @TestDefaultValue("42") Integer counter,
|
||||
@TestDefaultValue("2000") Long value, @TestDefaultValue("0.5") Float percentage,
|
||||
@TestDefaultValue("42.42") Double ratio) {
|
||||
this.flag = flag;
|
||||
this.octet = octet;
|
||||
this.letter = letter;
|
||||
|
||||
+6
-6
@@ -18,16 +18,16 @@ package org.springframework.boot.configurationsample.immutable;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.ConstructorBinding;
|
||||
import org.springframework.boot.configurationsample.DefaultValue;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConstructorBinding;
|
||||
import org.springframework.boot.configurationsample.TestDefaultValue;
|
||||
|
||||
/**
|
||||
* Simple properties, in immutable format.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("immutable")
|
||||
@TestConfigurationProperties("immutable")
|
||||
public class ImmutableSimpleProperties {
|
||||
|
||||
/**
|
||||
@@ -48,8 +48,8 @@ public class ImmutableSimpleProperties {
|
||||
@SuppressWarnings("unused")
|
||||
private final Long counter;
|
||||
|
||||
@ConstructorBinding
|
||||
public ImmutableSimpleProperties(@DefaultValue("boot") String theName, boolean flag, Comparator<?> comparator,
|
||||
@TestConstructorBinding
|
||||
public ImmutableSimpleProperties(@TestDefaultValue("boot") String theName, boolean flag, Comparator<?> comparator,
|
||||
Long counter) {
|
||||
this.theName = theName;
|
||||
this.flag = flag;
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.incremental;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties("bar")
|
||||
@TestConfigurationProperties("bar")
|
||||
public class BarProperties {
|
||||
|
||||
private String name;
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.incremental;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties("foo")
|
||||
@TestConfigurationProperties("foo")
|
||||
public class FooProperties {
|
||||
|
||||
private String name;
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.incremental;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties("bar")
|
||||
@TestConfigurationProperties("bar")
|
||||
public class RenamedBarProperties {
|
||||
|
||||
private String name;
|
||||
|
||||
+2
-2
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.inheritance;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
public class ChildPropertiesConfig {
|
||||
|
||||
@ConfigurationProperties("inheritance")
|
||||
@TestConfigurationProperties("inheritance")
|
||||
public ChildProperties childConfig() {
|
||||
return new ChildProperties();
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.inheritance;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
public class OverrideChildPropertiesConfig {
|
||||
|
||||
@ConfigurationProperties("inheritance")
|
||||
@TestConfigurationProperties("inheritance")
|
||||
public OverrideChildProperties overrideChildProperties() {
|
||||
return new OverrideChildProperties();
|
||||
}
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties using Lombok @Data on element level and overwriting behaviour
|
||||
@@ -30,7 +30,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
* @author Jonas Keßler
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("accesslevel.overwrite.data")
|
||||
@TestConfigurationProperties("accesslevel.overwrite.data")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokAccessLevelOverwriteDataProperties {
|
||||
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties using lombok @Getter and @Setter without explicitly defining
|
||||
@@ -30,7 +30,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ConfigurationProperties("accesslevel.overwrite.default")
|
||||
@TestConfigurationProperties("accesslevel.overwrite.default")
|
||||
public class LombokAccessLevelOverwriteDefaultProperties {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties using lombok @Getter and @Setter with explicitly defining
|
||||
@@ -30,7 +30,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
@Getter(AccessLevel.PUBLIC)
|
||||
@Setter(AccessLevel.PUBLIC)
|
||||
@ConfigurationProperties("accesslevel.overwrite.explicit")
|
||||
@TestConfigurationProperties("accesslevel.overwrite.explicit")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokAccessLevelOverwriteExplicitProperties {
|
||||
|
||||
|
||||
+2
-2
@@ -20,14 +20,14 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties without lombok annotations at element level.
|
||||
*
|
||||
* @author Jonas Keßler
|
||||
*/
|
||||
@ConfigurationProperties("accesslevel")
|
||||
@TestConfigurationProperties("accesslevel")
|
||||
public class LombokAccessLevelProperties {
|
||||
|
||||
@Getter(AccessLevel.PUBLIC)
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ package org.springframework.boot.configurationsample.lombok;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties with default values.
|
||||
@@ -26,7 +26,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("default")
|
||||
@TestConfigurationProperties("default")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokDefaultValueProperties {
|
||||
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ package org.springframework.boot.configurationsample.lombok;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Deprecated configuration properties.
|
||||
@@ -29,7 +29,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ConfigurationProperties("deprecated")
|
||||
@TestConfigurationProperties("deprecated")
|
||||
@Deprecated
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokDeprecatedProperties {
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ package org.springframework.boot.configurationsample.lombok;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties with a single deprecated element.
|
||||
@@ -26,7 +26,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("singledeprecated")
|
||||
@TestConfigurationProperties("singledeprecated")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokDeprecatedSingleProperty {
|
||||
|
||||
|
||||
+2
-2
@@ -22,14 +22,14 @@ import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties using lombok @Getter/@Setter at field level.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("explicit")
|
||||
@TestConfigurationProperties("explicit")
|
||||
public class LombokExplicitProperties {
|
||||
|
||||
@Getter
|
||||
|
||||
+4
-4
@@ -18,8 +18,8 @@ package org.springframework.boot.configurationsample.lombok;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestNestedConfigurationProperty;
|
||||
|
||||
/**
|
||||
* Demonstrate the auto-detection of inner config classes using Lombok.
|
||||
@@ -27,7 +27,7 @@ import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("config")
|
||||
@TestConfigurationProperties("config")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokInnerClassProperties {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class LombokInnerClassProperties {
|
||||
|
||||
private Foo second = new Foo();
|
||||
|
||||
@NestedConfigurationProperty
|
||||
@TestNestedConfigurationProperty
|
||||
private final SimpleLombokPojo third = new SimpleLombokPojo();
|
||||
|
||||
private Fourth fourth;
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ package org.springframework.boot.configurationsample.lombok;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
@Data
|
||||
@ConfigurationProperties("config")
|
||||
@TestConfigurationProperties("config")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokInnerClassWithGetterProperties {
|
||||
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties using lombok @Data.
|
||||
@@ -29,7 +29,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("data")
|
||||
@TestConfigurationProperties("data")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokSimpleDataProperties {
|
||||
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties using lombok @Getter/@Setter at class level.
|
||||
@@ -31,7 +31,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ConfigurationProperties("simple")
|
||||
@TestConfigurationProperties("simple")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokSimpleProperties {
|
||||
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties using Lombok {@code @Value}.
|
||||
@@ -29,7 +29,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
* @author Mark Jeffrey
|
||||
*/
|
||||
@Value
|
||||
@ConfigurationProperties("value")
|
||||
@TestConfigurationProperties("value")
|
||||
@SuppressWarnings("unused")
|
||||
public class LombokSimpleValueProperties {
|
||||
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing method configuration with deprecated class.
|
||||
@@ -27,7 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
@Deprecated
|
||||
public class DeprecatedClassMethodConfig {
|
||||
|
||||
@ConfigurationProperties("foo")
|
||||
@TestConfigurationProperties("foo")
|
||||
public Foo foo() {
|
||||
return new Foo();
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing deprecated method configuration.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
public class DeprecatedMethodConfig {
|
||||
|
||||
@ConfigurationProperties("foo")
|
||||
@TestConfigurationProperties("foo")
|
||||
@Deprecated
|
||||
public Foo foo() {
|
||||
return new Foo();
|
||||
|
||||
+3
-3
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing method configuration.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("something")
|
||||
@TestConfigurationProperties("something")
|
||||
public class EmptyTypeMethodConfig {
|
||||
|
||||
private String name;
|
||||
@@ -36,7 +36,7 @@ public class EmptyTypeMethodConfig {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@ConfigurationProperties("something")
|
||||
@TestConfigurationProperties("something")
|
||||
public Foo foo() {
|
||||
return new Foo();
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing invalid method configuration.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("something")
|
||||
@TestConfigurationProperties("something")
|
||||
public class InvalidMethodConfig {
|
||||
|
||||
private String name;
|
||||
@@ -36,7 +36,7 @@ public class InvalidMethodConfig {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@ConfigurationProperties("invalid")
|
||||
@TestConfigurationProperties("invalid")
|
||||
InvalidMethodConfig foo() {
|
||||
return new InvalidMethodConfig();
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing mixed method and class configuration.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("conflict")
|
||||
@TestConfigurationProperties("conflict")
|
||||
public class MethodAndClassConfig {
|
||||
|
||||
private String value;
|
||||
@@ -36,7 +36,7 @@ public class MethodAndClassConfig {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@ConfigurationProperties("conflict")
|
||||
@TestConfigurationProperties("conflict")
|
||||
public Foo foo() {
|
||||
return new Foo();
|
||||
}
|
||||
|
||||
+5
-5
@@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestNestedConfigurationProperty;
|
||||
|
||||
@ConfigurationProperties("method-nested")
|
||||
@TestConfigurationProperties("method-nested")
|
||||
public class NestedPropertiesMethod {
|
||||
|
||||
private String myProperty;
|
||||
@@ -36,7 +36,7 @@ public class NestedPropertiesMethod {
|
||||
this.myProperty = myProperty;
|
||||
}
|
||||
|
||||
@NestedConfigurationProperty
|
||||
@TestNestedConfigurationProperty
|
||||
public NestedProperty getNested() {
|
||||
return this.nested;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class NestedPropertiesMethod {
|
||||
this.myInnerProperty = myInnerProperty;
|
||||
}
|
||||
|
||||
@NestedConfigurationProperty
|
||||
@TestNestedConfigurationProperty
|
||||
public NestedProperty getNested() {
|
||||
return this.nested;
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing package-private method configuration.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
public class PackagePrivateMethodConfig {
|
||||
|
||||
@ConfigurationProperties("foo")
|
||||
@TestConfigurationProperties("foo")
|
||||
Foo foo() {
|
||||
return new Foo();
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing private method configuration.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
public class PrivateMethodConfig {
|
||||
|
||||
@ConfigurationProperties("foo")
|
||||
@TestConfigurationProperties("foo")
|
||||
private Foo foo() {
|
||||
return new Foo();
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing protected method configuration.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
public class ProtectedMethodConfig {
|
||||
|
||||
@ConfigurationProperties("foo")
|
||||
@TestConfigurationProperties("foo")
|
||||
protected Foo foo() {
|
||||
return new Foo();
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing public method configuration.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
*/
|
||||
public class PublicMethodConfig {
|
||||
|
||||
@ConfigurationProperties("foo")
|
||||
@TestConfigurationProperties("foo")
|
||||
public Foo foo() {
|
||||
return new Foo();
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.method;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Sample for testing method configuration that uses a constructor that should not be
|
||||
@@ -27,7 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
@SuppressWarnings("unused")
|
||||
public class SingleConstructorMethodConfig {
|
||||
|
||||
@ConfigurationProperties("foo")
|
||||
@TestConfigurationProperties("foo")
|
||||
public Foo foo() {
|
||||
return new Foo(new Object());
|
||||
}
|
||||
|
||||
+6
-6
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.name;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.DefaultValue;
|
||||
import org.springframework.boot.configurationsample.Name;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestDefaultValue;
|
||||
import org.springframework.boot.configurationsample.TestName;
|
||||
|
||||
/**
|
||||
* Constructor properties making use of {@code @Name}.
|
||||
@@ -26,7 +26,7 @@ import org.springframework.boot.configurationsample.Name;
|
||||
* @author Phillip Webb
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("named")
|
||||
@TestConfigurationProperties("named")
|
||||
public class ConstructorParameterNameAnnotationProperties {
|
||||
|
||||
/**
|
||||
@@ -39,8 +39,8 @@ public class ConstructorParameterNameAnnotationProperties {
|
||||
*/
|
||||
private final boolean defaultValue;
|
||||
|
||||
public ConstructorParameterNameAnnotationProperties(@Name("import") String imports,
|
||||
@Name("default") @DefaultValue("true") boolean defaultValue) {
|
||||
public ConstructorParameterNameAnnotationProperties(@TestName("import") String imports,
|
||||
@TestName("default") @TestDefaultValue("true") boolean defaultValue) {
|
||||
this.imports = imports;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
+5
-5
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.name;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.Name;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestName;
|
||||
|
||||
/**
|
||||
* Java bean properties making use of {@code @Name}.
|
||||
@@ -25,19 +25,19 @@ import org.springframework.boot.configurationsample.Name;
|
||||
* @author Andy Wilkinson
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("named")
|
||||
@TestConfigurationProperties("named")
|
||||
public class JavaBeanNameAnnotationProperties {
|
||||
|
||||
/**
|
||||
* Imports to apply.
|
||||
*/
|
||||
@Name("import")
|
||||
@TestName("import")
|
||||
private String imports;
|
||||
|
||||
/**
|
||||
* Whether default mode is enabled.
|
||||
*/
|
||||
@Name("default")
|
||||
@TestName("default")
|
||||
private boolean defaultValue = true;
|
||||
|
||||
public String getImports() {
|
||||
|
||||
+5
-5
@@ -19,8 +19,8 @@ package org.springframework.boot.configurationsample.name;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.Name;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestName;
|
||||
|
||||
/**
|
||||
* Lombok properties making use of {@code @Name}.
|
||||
@@ -29,19 +29,19 @@ import org.springframework.boot.configurationsample.Name;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ConfigurationProperties("named")
|
||||
@TestConfigurationProperties("named")
|
||||
public class LombokNameAnnotationProperties {
|
||||
|
||||
/**
|
||||
* Imports to apply.
|
||||
*/
|
||||
@Name("import")
|
||||
@TestName("import")
|
||||
private String imports;
|
||||
|
||||
/**
|
||||
* Whether default mode is enabled.
|
||||
*/
|
||||
@Name("default")
|
||||
@TestName("default")
|
||||
private boolean defaultValue = true;
|
||||
|
||||
}
|
||||
|
||||
+6
-6
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.name;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.DefaultValue;
|
||||
import org.springframework.boot.configurationsample.Name;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestDefaultValue;
|
||||
import org.springframework.boot.configurationsample.TestName;
|
||||
|
||||
/**
|
||||
* Record properties making use of {@code @Name}.
|
||||
@@ -28,8 +28,8 @@ import org.springframework.boot.configurationsample.Name;
|
||||
* @author Andy Wilkinson
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("named")
|
||||
public record RecordComponentNameAnnotationProperties(@Name("import") String imports,
|
||||
@Name("default") @DefaultValue("true") boolean defaultValue) {
|
||||
@TestConfigurationProperties("named")
|
||||
public record RecordComponentNameAnnotationProperties(@TestName("import") String imports,
|
||||
@TestName("default") @TestDefaultValue("true") boolean defaultValue) {
|
||||
|
||||
}
|
||||
|
||||
+4
-3
@@ -16,7 +16,8 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.record;
|
||||
|
||||
import org.springframework.boot.configurationsample.Name;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestName;
|
||||
|
||||
/**
|
||||
* Example Record Javadoc sample
|
||||
@@ -30,7 +31,7 @@ import org.springframework.boot.configurationsample.Name;
|
||||
* @since 1.0.0
|
||||
* @author Pavel Anisimov
|
||||
*/
|
||||
@org.springframework.boot.configurationsample.ConfigurationProperties("record.descriptions")
|
||||
@TestConfigurationProperties("record.descriptions")
|
||||
public record ExampleRecord(String someString, Integer someInteger, Boolean someBoolean, Long someLong,
|
||||
@Name("named.record.component") String namedComponent, Byte someByte) {
|
||||
@TestName("named.record.component") String namedComponent, Byte someByte) {
|
||||
}
|
||||
|
||||
+5
-5
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.record;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.NestedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestNestedConfigurationProperty;
|
||||
|
||||
@ConfigurationProperties("record-nested")
|
||||
public record NestedPropertiesRecord(String myProperty, @NestedConfigurationProperty NestedRecord nested,
|
||||
@TestConfigurationProperties("record-nested")
|
||||
public record NestedPropertiesRecord(String myProperty, @TestNestedConfigurationProperty NestedRecord nested,
|
||||
InnerPropertiesRecord inner) {
|
||||
|
||||
public record InnerPropertiesRecord(String myInnerProperty, @NestedConfigurationProperty NestedRecord nested) {
|
||||
public record InnerPropertiesRecord(String myInnerProperty, @TestNestedConfigurationProperty NestedRecord nested) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.record;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties("record-with-getter")
|
||||
@TestConfigurationProperties("record-with-getter")
|
||||
public record RecordWithGetter(String alpha) {
|
||||
|
||||
public String getBravo() {
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.recursive;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties("prefix")
|
||||
@TestConfigurationProperties("prefix")
|
||||
public class RecursiveProperties {
|
||||
|
||||
private RecursiveProperties recursive;
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.Autowired;
|
||||
import org.springframework.boot.configurationsample.TestAutowired;
|
||||
|
||||
/**
|
||||
* Properties with autowired constructor.
|
||||
@@ -30,7 +30,7 @@ public class AutowiredProperties {
|
||||
*/
|
||||
private String theName;
|
||||
|
||||
@Autowired
|
||||
@TestAutowired
|
||||
public AutowiredProperties(String theName) {
|
||||
this.theName = theName;
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Class with nested configuration properties.
|
||||
@@ -39,7 +39,7 @@ public class ClassWithNestedProperties {
|
||||
|
||||
}
|
||||
|
||||
@ConfigurationProperties("nestedChildProps")
|
||||
@TestConfigurationProperties("nestedChildProps")
|
||||
public static class NestedChildClass extends NestedParentClass {
|
||||
|
||||
private int childClassProperty = 20;
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties with a single deprecated element.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
@ConfigurationProperties("singlefielddeprecated")
|
||||
@TestConfigurationProperties("singlefielddeprecated")
|
||||
public class DeprecatedFieldSingleProperty {
|
||||
|
||||
@Deprecated
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Deprecated configuration properties.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
* @deprecated deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
@ConfigurationProperties("deprecated")
|
||||
@TestConfigurationProperties("deprecated")
|
||||
public class DeprecatedProperties {
|
||||
|
||||
private String name;
|
||||
|
||||
+7
-7
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.DeprecatedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.Name;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestDeprecatedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestName;
|
||||
|
||||
/**
|
||||
* Configuration properties as record with deprecated property.
|
||||
@@ -28,17 +28,17 @@ import org.springframework.boot.configurationsample.Name;
|
||||
* @param charlie charlie property, named, deprecated
|
||||
* @author Moritz Halbritter
|
||||
*/
|
||||
@ConfigurationProperties("deprecated-record")
|
||||
public record DeprecatedRecord(String alpha, String bravo, @Name("named.charlie") String charlie) {
|
||||
@TestConfigurationProperties("deprecated-record")
|
||||
public record DeprecatedRecord(String alpha, String bravo, @TestName("named.charlie") String charlie) {
|
||||
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(reason = "some-reason")
|
||||
@TestDeprecatedConfigurationProperty(reason = "some-reason")
|
||||
public String alpha() {
|
||||
return this.alpha;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(reason = "another-reason")
|
||||
@TestDeprecatedConfigurationProperty(reason = "another-reason")
|
||||
public String charlie() {
|
||||
return this.charlie;
|
||||
}
|
||||
|
||||
+4
-4
@@ -16,21 +16,21 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.DeprecatedConfigurationProperty;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestDeprecatedConfigurationProperty;
|
||||
|
||||
/**
|
||||
* Configuration properties with a single deprecated element.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ConfigurationProperties("singledeprecated")
|
||||
@TestConfigurationProperties("singledeprecated")
|
||||
public class DeprecatedSingleProperty {
|
||||
|
||||
private String newName;
|
||||
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(reason = "renamed", replacement = "singledeprecated.new-name", since = "1.2.3")
|
||||
@TestDeprecatedConfigurationProperty(reason = "renamed", replacement = "singledeprecated.new-name", since = "1.2.3")
|
||||
public String getName() {
|
||||
return getNewName();
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties with various description styles.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("description")
|
||||
@TestConfigurationProperties("description")
|
||||
public class DescriptionProperties {
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties with inherited values.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("hierarchical")
|
||||
@TestConfigurationProperties("hierarchical")
|
||||
public class HierarchicalProperties extends HierarchicalPropertiesParent {
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties where some of them are being ignored.
|
||||
*
|
||||
* @author Moritz Halbritter
|
||||
*/
|
||||
@ConfigurationProperties("ignored")
|
||||
@TestConfigurationProperties("ignored")
|
||||
public class IgnoredProperties {
|
||||
|
||||
private String prop1;
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Nested properties with a private constructor.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ConfigurationProperties("config")
|
||||
@TestConfigurationProperties("config")
|
||||
public class InnerClassWithPrivateConstructor {
|
||||
|
||||
private Nested nested = new Nested("whatever");
|
||||
|
||||
+2
-2
@@ -18,14 +18,14 @@ package org.springframework.boot.configurationsample.simple;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
import org.springframework.boot.configurationsample.TestConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Properties with array.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("array")
|
||||
@TestConfigurationProperties("array")
|
||||
public class SimpleArrayProperties {
|
||||
|
||||
private int[] primitive;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user