diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java index 8c937b5977..45d778144b 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java @@ -78,7 +78,7 @@ public class SimpleHealthIndicator implements HealthIndicator health = this.indicator.health(); + System.err.println(health); + assertNotNull(health.get("database")); + assertEquals("ok", health.get("status")); + assertNotNull(health.get("hello")); + } + + @Test + public void error() { + this.indicator.setDataSource(this.dataSource); + this.indicator.setQuery("SELECT COUNT(*) from BAR"); + Map health = this.indicator.health(); + assertNotNull(health.get("database")); + assertEquals("error", health.get("status")); + } + @Test public void connectionClosed() throws Exception { DataSource dataSource = mock(DataSource.class);