From c4387e1e8a8b22e1ed19980d1e997e1f601e78b3 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 27 Nov 2017 10:30:31 +0100 Subject: [PATCH] Polish "Add CouchbaseHealthIndicatorTests" Closes gh-11161 --- .../actuate/couchbase/CouchbaseHealthIndicatorTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicatorTests.java index 3535cb6a79..9c3ee8a5ed 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicatorTests.java @@ -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(); } + }