Polish "Add CouchbaseHealthIndicatorTests"
Closes gh-11161
This commit is contained in:
parent
2e9ca06688
commit
c4387e1e8a
|
|
@ -56,12 +56,14 @@ public class CouchbaseHealthIndicatorTests {
|
||||||
@Test
|
@Test
|
||||||
public void couchbaseIsDown() {
|
public void couchbaseIsDown() {
|
||||||
CouchbaseOperations couchbaseOperations = mock(CouchbaseOperations.class);
|
CouchbaseOperations couchbaseOperations = mock(CouchbaseOperations.class);
|
||||||
given(couchbaseOperations.getCouchbaseClusterInfo()).willThrow(new NullPointerException());
|
given(couchbaseOperations.getCouchbaseClusterInfo()).willThrow(
|
||||||
|
new IllegalStateException("test, expected"));
|
||||||
CouchbaseHealthIndicator healthIndicator = new CouchbaseHealthIndicator(
|
CouchbaseHealthIndicator healthIndicator = new CouchbaseHealthIndicator(
|
||||||
couchbaseOperations);
|
couchbaseOperations);
|
||||||
Health health = healthIndicator.health();
|
Health health = healthIndicator.health();
|
||||||
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
|
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
|
||||||
assertThat((String) health.getDetails().get("error")).contains("null");
|
assertThat((String) health.getDetails().get("error")).contains("test, expected");
|
||||||
verify(couchbaseOperations).getCouchbaseClusterInfo();
|
verify(couchbaseOperations).getCouchbaseClusterInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue