diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java index 38373dfce8..ca79e4240e 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java @@ -114,7 +114,7 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator List results = this.jdbcTemplate.query(validationQuery, new SingleColumnRowMapper()); Object result = DataAccessUtils.requiredSingleResult(results); - builder.withDetail("hello", result); + builder.withDetail("result", result); } } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java index 22378d8b48..77dab42857 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java @@ -67,7 +67,7 @@ public class DataSourceHealthIndicatorTests { this.indicator.setDataSource(this.dataSource); Health health = this.indicator.health(); assertThat(health.getDetails().get("database")).isNotNull(); - assertThat(health.getDetails().get("hello")).isNotNull(); + assertThat(health.getDetails().get("result")).isNotNull(); } @Test @@ -80,7 +80,7 @@ public class DataSourceHealthIndicatorTests { System.err.println(health); assertThat(health.getDetails().get("database")).isNotNull(); assertThat(health.getStatus()).isEqualTo(Status.UP); - assertThat(health.getDetails().get("hello")).isNotNull(); + assertThat(health.getDetails().get("result")).isNotNull(); } @Test