Require annotation signal for constructor binding
Update `@ConfigurationProperties` constructor binding support to only apply when a `@ConstructorBinding` annotation is present on either the type or the specific constructor to use. Prior to this commit we didn't have a good way to tell when constructor binding should be used vs regular autowiring. For convenience, an `@ImmutableConfigurationProperties` meta-annotation has also been added which is composed of `@ConfigurationProperties` and `@ConstructorBinding`. Closes gh-18469
This commit is contained in:
@@ -16,16 +16,16 @@
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.web.client;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.ImmutableConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.bind.DefaultValue;
|
||||
|
||||
/**
|
||||
* Example {@link ConfigurationProperties} used to test the use of configuration
|
||||
* properties scan with sliced test.
|
||||
* Example {@link ImmutableConfigurationProperties @ImmutableConfigurationProperties} used
|
||||
* to test the use of configuration properties scan with sliced test.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ConfigurationProperties("example")
|
||||
@ImmutableConfigurationProperties("example")
|
||||
public class ExampleProperties {
|
||||
|
||||
private final String name;
|
||||
|
||||
Reference in New Issue
Block a user