Merge branch '2.3.x'

Closes gh-23157
This commit is contained in:
Stephane Nicoll
2020-09-01 11:50:40 +02:00
3 changed files with 6 additions and 6 deletions

View File

@@ -31,7 +31,7 @@ import org.springframework.core.io.ClassPathResource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.when;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
/**
@@ -63,7 +63,7 @@ class Hazelcast4HazelcastHealthIndicatorTests {
@Test
void hazelcastDown() {
HazelcastInstance hazelcast = mock(HazelcastInstance.class);
when(hazelcast.executeTransaction(any())).thenThrow(new HazelcastException());
given(hazelcast.executeTransaction(any())).willThrow(new HazelcastException());
Health health = new HazelcastHealthIndicator(hazelcast).health();
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
}

View File

@@ -29,7 +29,7 @@ import org.springframework.core.io.ClassPathResource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.when;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
/**
@@ -59,7 +59,7 @@ class HazelcastHealthIndicatorTests {
@Test
void hazelcastDown() {
HazelcastInstance hazelcast = mock(HazelcastInstance.class);
when(hazelcast.executeTransaction(any())).thenThrow(new HazelcastException());
given(hazelcast.executeTransaction(any())).willThrow(new HazelcastException());
Health health = new HazelcastHealthIndicator(hazelcast).health();
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
}