Change DataSourceHealthIndicator details from "hello" to "result"

Closes gh-15136
pull/15385/head
Andre Restolho 6 years ago committed by Stephane Nicoll
parent 84ace92a27
commit d9586d94f6

@ -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