Commit 14a67605 authored by Stephane Nicoll's avatar Stephane Nicoll

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.
parent 39fed4a9
......@@ -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
* @deprecated since 2.2.0 in favor of {@link HealthEndpointProperties}
*/
@Deprecated
@ConfigurationProperties(prefix = "management.health.status")
public class HealthIndicatorProperties {
private final HealthEndpointProperties healthEndpointProperties;
......
......@@ -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;
class LegacyHealthEndpointCompatibiltyConfiguration {
@Bean
@ConfigurationProperties(prefix = "management.health.status")
HealthIndicatorProperties healthIndicatorProperties(HealthEndpointProperties healthEndpointProperties) {
return new HealthIndicatorProperties(healthEndpointProperties);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment