Skip to content

Commit 1ed736a

Browse files
Bump Mockito to 4.11.0
1 parent 41bcd4c commit 1ed736a

4 files changed

Lines changed: 31 additions & 40 deletions

File tree

maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
import static org.mockito.Mockito.never;
9393
import static org.mockito.Mockito.times;
9494
import static org.mockito.Mockito.verify;
95+
import static org.mockito.Mockito.verifyNoInteractions;
9596
import static org.mockito.Mockito.verifyNoMoreInteractions;
96-
import static org.mockito.Mockito.verifyZeroInteractions;
9797
import static org.mockito.Mockito.when;
9898

9999
/**
@@ -319,7 +319,7 @@ public void shouldAcquireNextTest() {
319319
client.handleEvent(new ControlNextTestEvent());
320320
verify(notifiableTestStream, times(1)).provideNewTest();
321321
verifyNoMoreInteractions(notifiableTestStream);
322-
verifyZeroInteractions(factory);
322+
verifyNoInteractions(factory);
323323
assertThat(client.isSaidGoodBye()).isFalse();
324324
assertThat(client.getErrorInFork()).isNull();
325325
assertThat(client.isErrorInFork()).isFalse();
@@ -344,7 +344,7 @@ public void shouldNotifyWithBye() {
344344
verify(notifiableTestStream, times(1)).acknowledgeByeEventReceived();
345345
verify(notifiableTestStream, never()).shutdown(any(Shutdown.class));
346346
verifyNoMoreInteractions(notifiableTestStream);
347-
verifyZeroInteractions(factory);
347+
verifyNoInteractions(factory);
348348
assertThat(client.isSaidGoodBye()).isTrue();
349349
assertThat(client.getErrorInFork()).isNull();
350350
assertThat(client.isErrorInFork()).isFalse();
@@ -365,8 +365,8 @@ public void shouldStopOnNextTest() {
365365
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
366366
client.setStopOnNextTestListener(() -> verified[0] = true);
367367
client.handleEvent(new ControlStopOnNextTestEvent());
368-
verifyZeroInteractions(notifiableTestStream);
369-
verifyZeroInteractions(factory);
368+
verifyNoInteractions(notifiableTestStream);
369+
verifyNoInteractions(factory);
370370
assertThat(verified[0]).isTrue();
371371
assertThat(client.isSaidGoodBye()).isFalse();
372372
assertThat(client.getErrorInFork()).isNull();
@@ -388,7 +388,7 @@ public void shouldReceiveStdOut() {
388388
NotifiableTestStream notifiableTestStream = mock(NotifiableTestStream.class);
389389
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
390390
client.handleEvent(new StandardStreamOutEvent(NORMAL_RUN, 1L, "msg", null));
391-
verifyZeroInteractions(notifiableTestStream);
391+
verifyNoInteractions(notifiableTestStream);
392392
verify(factory, times(1)).createTestReportListener();
393393
verifyNoMoreInteractions(factory);
394394
assertThat(client.getReporter()).isNotNull();
@@ -414,7 +414,7 @@ public void shouldReceiveStdOutNewLine() {
414414
NotifiableTestStream notifiableTestStream = mock(NotifiableTestStream.class);
415415
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
416416
client.handleEvent(new StandardStreamOutWithNewLineEvent(NORMAL_RUN, 1L, "msg", null));
417-
verifyZeroInteractions(notifiableTestStream);
417+
verifyNoInteractions(notifiableTestStream);
418418
verify(factory, times(1)).createTestReportListener();
419419
verifyNoMoreInteractions(factory);
420420
assertThat(client.getReporter()).isNotNull();
@@ -440,7 +440,7 @@ public void shouldReceiveStdErr() {
440440
NotifiableTestStream notifiableTestStream = mock(NotifiableTestStream.class);
441441
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
442442
client.handleEvent(new StandardStreamErrEvent(NORMAL_RUN, 1L, "msg", null));
443-
verifyZeroInteractions(notifiableTestStream);
443+
verifyNoInteractions(notifiableTestStream);
444444
verify(factory, times(1)).createTestReportListener();
445445
verifyNoMoreInteractions(factory);
446446
assertThat(client.getReporter()).isNotNull();
@@ -466,7 +466,7 @@ public void shouldReceiveStdErrNewLine() {
466466
NotifiableTestStream notifiableTestStream = mock(NotifiableTestStream.class);
467467
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
468468
client.handleEvent(new StandardStreamErrWithNewLineEvent(NORMAL_RUN, 1L, "msg", null));
469-
verifyZeroInteractions(notifiableTestStream);
469+
verifyNoInteractions(notifiableTestStream);
470470
verify(factory, times(1)).createTestReportListener();
471471
verifyNoMoreInteractions(factory);
472472
assertThat(client.getReporter()).isNotNull();
@@ -492,7 +492,7 @@ public void shouldLogConsoleError() {
492492
new DeserializedStacktraceWriter("Listening for transport dt_socket at address: 5005", null, null);
493493
Event event = new ConsoleErrorEvent(stackTrace);
494494
client.handleEvent(event);
495-
verifyZeroInteractions(notifiableTestStream);
495+
verifyNoInteractions(notifiableTestStream);
496496
verify(factory, times(1)).createTestReportListener();
497497
verify(factory, times(1)).getReportsDirectory();
498498
verifyNoMoreInteractions(factory);
@@ -555,7 +555,7 @@ public void shouldLogConsoleWarning() {
555555
NotifiableTestStream notifiableTestStream = mock(NotifiableTestStream.class);
556556
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
557557
client.handleEvent(new ConsoleWarningEvent("s1"));
558-
verifyZeroInteractions(notifiableTestStream);
558+
verifyNoInteractions(notifiableTestStream);
559559
verify(factory, times(1)).createTestReportListener();
560560
verifyNoMoreInteractions(factory);
561561
assertThat(client.getReporter()).isNotNull();
@@ -581,7 +581,7 @@ public void shouldLogConsoleDebug() {
581581
NotifiableTestStream notifiableTestStream = mock(NotifiableTestStream.class);
582582
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
583583
client.handleEvent(new ConsoleDebugEvent("s1"));
584-
verifyZeroInteractions(notifiableTestStream);
584+
verifyNoInteractions(notifiableTestStream);
585585
verify(factory, times(1)).createTestReportListener();
586586
verifyNoMoreInteractions(factory);
587587
assertThat(client.getReporter()).isNotNull();
@@ -607,7 +607,7 @@ public void shouldLogConsoleInfo() {
607607
NotifiableTestStream notifiableTestStream = mock(NotifiableTestStream.class);
608608
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
609609
client.handleEvent(new ConsoleInfoEvent("s1"));
610-
verifyZeroInteractions(notifiableTestStream);
610+
verifyNoInteractions(notifiableTestStream);
611611
verify(factory, times(1)).createTestReportListener();
612612
verifyNoMoreInteractions(factory);
613613
assertThat(client.getReporter()).isNotNull();
@@ -633,8 +633,8 @@ public void shouldSendSystemProperty() {
633633
NotifiableTestStream notifiableTestStream = mock(NotifiableTestStream.class);
634634
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
635635
client.handleEvent(new SystemPropertyEvent(NORMAL_RUN, 1L, "k1", "v1"));
636-
verifyZeroInteractions(notifiableTestStream);
637-
verifyZeroInteractions(factory);
636+
verifyNoInteractions(notifiableTestStream);
637+
verifyNoInteractions(factory);
638638
assertThat(client.getReporter()).isNotNull();
639639
assertThat(receiver.getEvents()).isEmpty();
640640
assertThat(receiver.getData()).isEmpty();
@@ -769,7 +769,7 @@ public void shouldSendTestsetStarting() {
769769
client.handleEvent(new TestsetStartingEvent(reportEntry));
770770
client.tryToTimeout(System.currentTimeMillis(), 1);
771771

772-
verifyZeroInteractions(notifiableTestStream);
772+
verifyNoInteractions(notifiableTestStream);
773773
verify(factory).createTestReportListener();
774774
verifyNoMoreInteractions(factory);
775775
assertThat(client.getReporter()).isNotNull();
@@ -849,7 +849,7 @@ public void shouldSendTestsetCompleted() {
849849
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
850850
client.handleEvent(new TestsetCompletedEvent(reportEntry));
851851

852-
verifyZeroInteractions(notifiableTestStream);
852+
verifyNoInteractions(notifiableTestStream);
853853
verify(factory).createTestReportListener();
854854
verifyNoMoreInteractions(factory);
855855
assertThat(client.getReporter()).isNotNull();
@@ -929,7 +929,7 @@ public void shouldSendTestStarting() {
929929
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
930930
client.handleEvent(new TestStartingEvent(reportEntry));
931931

932-
verifyZeroInteractions(notifiableTestStream);
932+
verifyNoInteractions(notifiableTestStream);
933933
verify(factory).createTestReportListener();
934934
verifyNoMoreInteractions(factory);
935935
assertThat(client.hasTestsInProgress()).isTrue();
@@ -1015,7 +1015,7 @@ public void shouldSendTestSucceeded() {
10151015

10161016
client.handleEvent(new TestSucceededEvent(reportEntry));
10171017

1018-
verifyZeroInteractions(notifiableTestStream);
1018+
verifyNoInteractions(notifiableTestStream);
10191019
verify(factory).createTestReportListener();
10201020
verifyNoMoreInteractions(factory);
10211021
assertThat(client.getReporter()).isNotNull();
@@ -1103,7 +1103,7 @@ public void shouldSendTestFailed() {
11031103

11041104
client.handleEvent(new TestFailedEvent(reportEntry));
11051105

1106-
verifyZeroInteractions(notifiableTestStream);
1106+
verifyNoInteractions(notifiableTestStream);
11071107
verify(factory).createTestReportListener();
11081108
verifyNoMoreInteractions(factory);
11091109
assertThat(client.getReporter()).isNotNull();
@@ -1195,7 +1195,7 @@ public void shouldSendTestSkipped() {
11951195

11961196
client.handleEvent(new TestSkippedEvent(reportEntry));
11971197

1198-
verifyZeroInteractions(notifiableTestStream);
1198+
verifyNoInteractions(notifiableTestStream);
11991199
verify(factory).createTestReportListener();
12001200
verifyNoMoreInteractions(factory);
12011201
assertThat(client.getReporter()).isNotNull();
@@ -1286,7 +1286,7 @@ public void shouldSendTestError() {
12861286

12871287
client.handleEvent(new TestErrorEvent(reportEntry));
12881288

1289-
verifyZeroInteractions(notifiableTestStream);
1289+
verifyNoInteractions(notifiableTestStream);
12901290
verify(factory).createTestReportListener();
12911291
verifyNoMoreInteractions(factory);
12921292
assertThat(client.getReporter()).isNotNull();
@@ -1375,7 +1375,7 @@ public void shouldSendTestAssumptionFailure() {
13751375

13761376
client.handleEvent(new TestAssumptionFailureEvent(reportEntry));
13771377

1378-
verifyZeroInteractions(notifiableTestStream);
1378+
verifyNoInteractions(notifiableTestStream);
13791379
verify(factory).createTestReportListener();
13801380
verifyNoMoreInteractions(factory);
13811381
assertThat(client.getReporter()).isNotNull();

maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import static org.mockito.Mockito.mock;
4343
import static org.mockito.Mockito.times;
4444
import static org.mockito.Mockito.verify;
45-
import static org.mockito.Mockito.verifyZeroInteractions;
45+
import static org.mockito.Mockito.verifyNoInteractions;
4646
import static org.mockito.Mockito.when;
4747

4848
/**
@@ -117,7 +117,7 @@ public Object answer(InvocationOnMock invocation) throws IOException {
117117

118118
assertThat(streamFeeder.getException()).isNull();
119119

120-
verifyZeroInteractions(logger);
120+
verifyNoInteractions(logger);
121121
}
122122

123123
@Test
@@ -141,6 +141,6 @@ public Object answer(InvocationOnMock invocation) throws IOException {
141141

142142
assertThat(streamFeeder.getException()).isNotNull().isInstanceOf(IOException.class);
143143

144-
verifyZeroInteractions(logger);
144+
verifyNoInteractions(logger);
145145
}
146146
}

pom.xml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,10 @@
227227
</dependency>
228228
<dependency>
229229
<groupId>org.mockito</groupId>
230-
<artifactId>mockito-core</artifactId>
231-
<version>3.12.4</version>
232-
</dependency>
233-
<dependency>
234-
<groupId>org.mockito</groupId>
235-
<artifactId>mockito-inline</artifactId>
236-
<version>3.12.4</version>
237-
</dependency>
238-
<dependency>
239-
<groupId>org.mockito</groupId>
240-
<artifactId>mockito-junit-jupiter</artifactId>
241-
<version>3.12.4</version>
230+
<artifactId>mockito-bom</artifactId>
231+
<version>4.11.0</version>
232+
<type>pom</type>
233+
<scope>import</scope>
242234
</dependency>
243235
<dependency>
244236
<groupId>junit</groupId>

surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
import static org.mockito.Mockito.never;
7575
import static org.mockito.Mockito.verify;
7676
import static org.mockito.Mockito.verifyNoMoreInteractions;
77-
import static org.mockito.Mockito.verifyZeroInteractions;
7877
import static org.mockito.Mockito.when;
7978

8079
/**
@@ -229,7 +228,7 @@ public void displayNamesInClassAndMethods() throws Exception {
229228
assertThat(report.getValue().getSourceText()).isNull();
230229
assertThat(report.getValue().getName()).isNull();
231230
assertThat(report.getValue().getSystemProperties()).isEmpty();
232-
verifyZeroInteractions(listener);
231+
verifyNoMoreInteractions(listener);
233232

234233
adapter.executionStarted(TestIdentifier.from(child1));
235234
report = ArgumentCaptor.forClass(SimpleReportEntry.class);

0 commit comments

Comments
 (0)