diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java index 2b0a4668ee..51d4f59725 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java @@ -54,7 +54,6 @@ import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; import org.springframework.boot.autoconfigure.mongo.MongoDataAutoConfiguration; import org.springframework.boot.autoconfigure.redis.RedisAutoConfiguration; import org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration; -import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.core.MongoTemplate; @@ -271,7 +270,6 @@ public class HealthIndicatorAutoConfiguration { } @Bean - @ConfigurationProperties("health.diskspace") public DiskSpaceHealthIndicatorProperties diskSpaceHealthIndicatorProperties() { return new DiskSpaceHealthIndicatorProperties(); } diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DiskSpaceHealthIndicatorProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DiskSpaceHealthIndicatorProperties.java index 02d405b7f4..2e057effe3 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DiskSpaceHealthIndicatorProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DiskSpaceHealthIndicatorProperties.java @@ -18,6 +18,7 @@ package org.springframework.boot.actuate.health; import java.io.File; +import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.util.Assert; /** @@ -26,11 +27,16 @@ import org.springframework.util.Assert; * @author Andy Wilkinson * @since 1.2.0 */ +@ConfigurationProperties("health.diskspace") public class DiskSpaceHealthIndicatorProperties { + private static final int MEGABYTES = 1024 * 1024; + + private static final int DEFAULT_THRESHOLD = 10 * MEGABYTES; + private File path = new File("."); - private long threshold = 10 * 1024 * 1024; + private long threshold = DEFAULT_THRESHOLD; public File getPath() { return this.path; diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 164bd36ca4..a93981a5f7 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -700,8 +700,8 @@ default converter(s) provided by `Jackson2ObjectMapperBuilder`. The `ObjectMapper` (or `XmlMapper` for Jackson XML converter) instance created by default have the following customized properties: -* MapperFeature.DEFAULT_VIEW_INCLUSION is disabled -* DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES is disabled +* `MapperFeature.DEFAULT_VIEW_INCLUSION` is disabled +* `DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES` is disabled Spring Boot has also some features to make it easier to customize this behavior.