Skip to content

Commit 56ae9cf

Browse files
committed
Merge pull request #15136 from restolho
* pr/15136: Change DataSourceHealthIndicator details from "hello" to "result"
2 parents 84ace92 + d9586d9 commit 56ae9cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private void doDataSourceHealthCheck(Health.Builder builder) throws Exception {
114114
List<Object> results = this.jdbcTemplate.query(validationQuery,
115115
new SingleColumnRowMapper());
116116
Object result = DataAccessUtils.requiredSingleResult(results);
117-
builder.withDetail("hello", result);
117+
builder.withDetail("result", result);
118118
}
119119
}
120120

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void database() {
6767
this.indicator.setDataSource(this.dataSource);
6868
Health health = this.indicator.health();
6969
assertThat(health.getDetails().get("database")).isNotNull();
70-
assertThat(health.getDetails().get("hello")).isNotNull();
70+
assertThat(health.getDetails().get("result")).isNotNull();
7171
}
7272

7373
@Test
@@ -80,7 +80,7 @@ public void customQuery() {
8080
System.err.println(health);
8181
assertThat(health.getDetails().get("database")).isNotNull();
8282
assertThat(health.getStatus()).isEqualTo(Status.UP);
83-
assertThat(health.getDetails().get("hello")).isNotNull();
83+
assertThat(health.getDetails().get("result")).isNotNull();
8484
}
8585

8686
@Test

0 commit comments

Comments
 (0)