Fix DataSourceHealthIndicator test failure

Fix failure introduced in commit 8af02ce05b.

See gh-11880
This commit is contained in:
Phillip Webb
2018-02-01 20:30:08 -08:00
parent 8af02ce05b
commit eb83b2e0c2

View File

@@ -86,7 +86,7 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator
super("DataSource health check failed");
this.dataSource = dataSource;
this.query = query;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = (dataSource == null ? null : new JdbcTemplate(dataSource));
}
@Override