use of org.influxdb.InfluxDBException in project spring-boot by spring-projects.
the class InfluxDbHealthIndicatorTests method influxDbIsDown.
@Test
void influxDbIsDown() {
InfluxDB influxDb = mock(InfluxDB.class);
given(influxDb.ping()).willThrow(new InfluxDBException(new IOException("Connection failed")));
InfluxDbHealthIndicator healthIndicator = new InfluxDbHealthIndicator(influxDb);
Health health = healthIndicator.health();
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
assertThat((String) health.getDetails().get("error")).contains("Connection failed");
then(influxDb).should().ping();
}
Aggregations