Skip to content

Commit f4c8668

Browse files
committed
Merge branch '2.3.x'
Closes gh-23157
2 parents 2e4b338 + 652561c commit f4c8668

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/Hazelcast4HazelcastHealthIndicatorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import static org.assertj.core.api.Assertions.assertThat;
3333
import static org.mockito.ArgumentMatchers.any;
34-
import static org.mockito.BDDMockito.when;
34+
import static org.mockito.BDDMockito.given;
3535
import static org.mockito.Mockito.mock;
3636

3737
/**
@@ -63,7 +63,7 @@ void hazelcastUp() throws IOException {
6363
@Test
6464
void hazelcastDown() {
6565
HazelcastInstance hazelcast = mock(HazelcastInstance.class);
66-
when(hazelcast.executeTransaction(any())).thenThrow(new HazelcastException());
66+
given(hazelcast.executeTransaction(any())).willThrow(new HazelcastException());
6767
Health health = new HazelcastHealthIndicator(hazelcast).health();
6868
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
6969
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import static org.assertj.core.api.Assertions.assertThat;
3131
import static org.mockito.ArgumentMatchers.any;
32-
import static org.mockito.BDDMockito.when;
32+
import static org.mockito.BDDMockito.given;
3333
import static org.mockito.Mockito.mock;
3434

3535
/**
@@ -59,7 +59,7 @@ void hazelcastUp() throws IOException {
5959
@Test
6060
void hazelcastDown() {
6161
HazelcastInstance hazelcast = mock(HazelcastInstance.class);
62-
when(hazelcast.executeTransaction(any())).thenThrow(new HazelcastException());
62+
given(hazelcast.executeTransaction(any())).willThrow(new HazelcastException());
6363
Health health = new HazelcastHealthIndicator(hazelcast).health();
6464
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
6565
}

src/checkstyle/checkstyle.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
</module>
4242
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
4343
<property name="maximum" value="0"/>
44-
<property name="format" value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)" />
44+
<property name="format" value="org\.mockito\.(Mockito|BDDMockito)\.(when|doThrow|doAnswer)" />
4545
<property name="message"
46-
value="Please use BDDMockito imports." />
46+
value="Please use BDD-style (given, when, then) using BDDMockito imports." />
4747
<property name="ignoreComments" value="true" />
4848
</module>
4949
<module name="io.spring.javaformat.checkstyle.check.SpringJavadocCheck">

0 commit comments

Comments
 (0)