Skip to content

Commit 14a6760

Browse files
committed
Polish
This commit moves `@ConfigurationProperties` to the `@Bean` factory method as this is unusual to put it at class level if it's exposed that way. As HealthIndicatorProperties has a constructor, this makes sure that the annotation processor enables JavaBean binding mode.
1 parent 39fed4a commit 14a6760

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.List;
2020
import java.util.Map;
2121

22-
import org.springframework.boot.context.properties.ConfigurationProperties;
2322
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
2423

2524
/**
@@ -30,7 +29,6 @@
3029
* @deprecated since 2.2.0 in favor of {@link HealthEndpointProperties}
3130
*/
3231
@Deprecated
33-
@ConfigurationProperties(prefix = "management.health.status")
3432
public class HealthIndicatorProperties {
3533

3634
private final HealthEndpointProperties healthEndpointProperties;

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/LegacyHealthEndpointCompatibiltyConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.springframework.boot.actuate.health.HealthStatusHttpMapper;
2121
import org.springframework.boot.actuate.health.OrderedHealthAggregator;
2222
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
23+
import org.springframework.boot.context.properties.ConfigurationProperties;
2324
import org.springframework.context.annotation.Bean;
2425
import org.springframework.context.annotation.Configuration;
2526

@@ -34,6 +35,7 @@
3435
class LegacyHealthEndpointCompatibiltyConfiguration {
3536

3637
@Bean
38+
@ConfigurationProperties(prefix = "management.health.status")
3739
HealthIndicatorProperties healthIndicatorProperties(HealthEndpointProperties healthEndpointProperties) {
3840
return new HealthIndicatorProperties(healthEndpointProperties);
3941
}

0 commit comments

Comments
 (0)