Merge pull request #15136 from restolho

* pr/15136:
  Change DataSourceHealthIndicator details from "hello" to "result"
pull/15385/head
Stephane Nicoll 6 years ago
commit 56ae9cfc7a

@ -114,7 +114,7 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator
List<Object> results = this.jdbcTemplate.query(validationQuery, List<Object> results = this.jdbcTemplate.query(validationQuery,
new SingleColumnRowMapper()); new SingleColumnRowMapper());
Object result = DataAccessUtils.requiredSingleResult(results); Object result = DataAccessUtils.requiredSingleResult(results);
builder.withDetail("hello", result); builder.withDetail("result", result);
} }
} }

@ -67,7 +67,7 @@ public class DataSourceHealthIndicatorTests {
this.indicator.setDataSource(this.dataSource); this.indicator.setDataSource(this.dataSource);
Health health = this.indicator.health(); Health health = this.indicator.health();
assertThat(health.getDetails().get("database")).isNotNull(); assertThat(health.getDetails().get("database")).isNotNull();
assertThat(health.getDetails().get("hello")).isNotNull(); assertThat(health.getDetails().get("result")).isNotNull();
} }
@Test @Test
@ -80,7 +80,7 @@ public class DataSourceHealthIndicatorTests {
System.err.println(health); System.err.println(health);
assertThat(health.getDetails().get("database")).isNotNull(); assertThat(health.getDetails().get("database")).isNotNull();
assertThat(health.getStatus()).isEqualTo(Status.UP); assertThat(health.getStatus()).isEqualTo(Status.UP);
assertThat(health.getDetails().get("hello")).isNotNull(); assertThat(health.getDetails().get("result")).isNotNull();
} }
@Test @Test

Loading…
Cancel
Save