From d9586d94f6ebfce41138c7736ea091e9f26aa9d4 Mon Sep 17 00:00:00 2001 From: Andre Restolho Date: Thu, 8 Nov 2018 20:03:03 +0000 Subject: [PATCH] Change DataSourceHealthIndicator details from "hello" to "result" Closes gh-15136 --- .../boot/actuate/jdbc/DataSourceHealthIndicator.java | 2 +- .../boot/actuate/jdbc/DataSourceHealthIndicatorTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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