diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java index c32d78418d8..c9b42e9e71c 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java @@ -58,7 +58,7 @@ class HazelcastHealthIndicatorTests { @Test void hazelcastDown() { - given(this.hazelcast.executeTransaction(any())).willReturn(new HazelcastException()); + given(this.hazelcast.executeTransaction(any())).willThrow(new HazelcastException()); Health health = new HazelcastHealthIndicator(this.hazelcast).health(); assertThat(health.getStatus()).isEqualTo(Status.DOWN); }