Browse Source

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.
pull/18187/head
Stephane Nicoll 6 years ago
parent
commit
14a676052f
  1. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java
  2. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/LegacyHealthEndpointCompatibiltyConfiguration.java

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

@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.health; @@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.health;
import java.util.List;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
/**
@ -30,7 +29,6 @@ import org.springframework.boot.context.properties.DeprecatedConfigurationProper @@ -30,7 +29,6 @@ import org.springframework.boot.context.properties.DeprecatedConfigurationProper
* @deprecated since 2.2.0 in favor of {@link HealthEndpointProperties}
*/
@Deprecated
@ConfigurationProperties(prefix = "management.health.status")
public class HealthIndicatorProperties {
private final HealthEndpointProperties healthEndpointProperties;

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

@ -20,6 +20,7 @@ import org.springframework.boot.actuate.health.HealthAggregator; @@ -20,6 +20,7 @@ import org.springframework.boot.actuate.health.HealthAggregator;
import org.springframework.boot.actuate.health.HealthStatusHttpMapper;
import org.springframework.boot.actuate.health.OrderedHealthAggregator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -34,6 +35,7 @@ import org.springframework.context.annotation.Configuration; @@ -34,6 +35,7 @@ import org.springframework.context.annotation.Configuration;
class LegacyHealthEndpointCompatibiltyConfiguration {
@Bean
@ConfigurationProperties(prefix = "management.health.status")
HealthIndicatorProperties healthIndicatorProperties(HealthEndpointProperties healthEndpointProperties) {
return new HealthIndicatorProperties(healthEndpointProperties);
}

Loading…
Cancel
Save