diff --git a/spring-geode-actuator/src/test/java/org/springframework/geode/boot/actuate/GeodeAsyncEventQueuesHealthIndicatorUnitTests.java b/spring-geode-actuator/src/test/java/org/springframework/geode/boot/actuate/GeodeAsyncEventQueuesHealthIndicatorUnitTests.java index b287ee58..54f9f5be 100644 --- a/spring-geode-actuator/src/test/java/org/springframework/geode/boot/actuate/GeodeAsyncEventQueuesHealthIndicatorUnitTests.java +++ b/spring-geode-actuator/src/test/java/org/springframework/geode/boot/actuate/GeodeAsyncEventQueuesHealthIndicatorUnitTests.java @@ -45,6 +45,10 @@ import org.springframework.data.gemfire.tests.mock.AsyncEventQueueMockObjects; * @see org.mockito.Mock * @see org.mockito.Mockito * @see org.mockito.junit.MockitoJUnitRunner + * @see org.apache.geode.cache.Cache + * @see org.apache.geode.cache.asyncqueue.AsyncEventQueue + * @see org.springframework.boot.actuate.health.Health + * @see org.springframework.geode.boot.actuate.GeodeAsyncEventQueuesHealthIndicator * @since 1.0.0 */ @RunWith(MockitoJUnitRunner.class) @@ -121,4 +125,19 @@ public class GeodeAsyncEventQueuesHealthIndicatorUnitTests { verify(this.mockCache, times(1)).getAsyncEventQueues(); } + + @Test + public void healthCheckFailsWhenNoGemFireCacheIsPresent() throws Exception { + + GeodeAsyncEventQueuesHealthIndicator healthIndicator = new GeodeAsyncEventQueuesHealthIndicator(); + + Health.Builder builder = new Health.Builder(); + + healthIndicator.doHealthCheck(builder); + + Health health = builder.build(); + + assertThat(health).isNotNull(); + assertThat(health.getStatus()).isEqualTo(Status.UNKNOWN); + } }