Commit c4387e1e authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Add CouchbaseHealthIndicatorTests"

Closes gh-11161
parent 2e9ca066
......@@ -56,12 +56,14 @@ public class CouchbaseHealthIndicatorTests {
@Test
public void couchbaseIsDown() {
CouchbaseOperations couchbaseOperations = mock(CouchbaseOperations.class);
given(couchbaseOperations.getCouchbaseClusterInfo()).willThrow(new NullPointerException());
given(couchbaseOperations.getCouchbaseClusterInfo()).willThrow(
new IllegalStateException("test, expected"));
CouchbaseHealthIndicator healthIndicator = new CouchbaseHealthIndicator(
couchbaseOperations);
Health health = healthIndicator.health();
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();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment