This is an automated email from the ASF dual-hosted git repository.
sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/master by this push:
new 1ed736a92 Bump Mockito to 4.11.0
1ed736a92 is described below
commit 1ed736a9298eb1ce9fbd44c058304e1d70a52ace
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Fri Mar 13 23:03:44 2026 +0100
Bump Mockito to 4.11.0
---
.../booterclient/output/ForkClientTest.java | 46 +++++++++++-----------
.../surefire/extensions/StreamFeederTest.java | 6 +--
pom.xml | 16 ++------
.../junitplatform/RunListenerAdapterTest.java | 3 +-
4 files changed, 31 insertions(+), 40 deletions(-)
diff --git
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java
index f8cc60990..dc98bf5ac 100644
---
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java
+++
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java
@@ -92,8 +92,8 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
/**
@@ -319,7 +319,7 @@ public void shouldAcquireNextTest() {
client.handleEvent(new ControlNextTestEvent());
verify(notifiableTestStream, times(1)).provideNewTest();
verifyNoMoreInteractions(notifiableTestStream);
- verifyZeroInteractions(factory);
+ verifyNoInteractions(factory);
assertThat(client.isSaidGoodBye()).isFalse();
assertThat(client.getErrorInFork()).isNull();
assertThat(client.isErrorInFork()).isFalse();
@@ -344,7 +344,7 @@ public void shouldNotifyWithBye() {
verify(notifiableTestStream, times(1)).acknowledgeByeEventReceived();
verify(notifiableTestStream, never()).shutdown(any(Shutdown.class));
verifyNoMoreInteractions(notifiableTestStream);
- verifyZeroInteractions(factory);
+ verifyNoInteractions(factory);
assertThat(client.isSaidGoodBye()).isTrue();
assertThat(client.getErrorInFork()).isNull();
assertThat(client.isErrorInFork()).isFalse();
@@ -365,8 +365,8 @@ public void shouldStopOnNextTest() {
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.setStopOnNextTestListener(() -> verified[0] = true);
client.handleEvent(new ControlStopOnNextTestEvent());
- verifyZeroInteractions(notifiableTestStream);
- verifyZeroInteractions(factory);
+ verifyNoInteractions(notifiableTestStream);
+ verifyNoInteractions(factory);
assertThat(verified[0]).isTrue();
assertThat(client.isSaidGoodBye()).isFalse();
assertThat(client.getErrorInFork()).isNull();
@@ -388,7 +388,7 @@ public void shouldReceiveStdOut() {
NotifiableTestStream notifiableTestStream =
mock(NotifiableTestStream.class);
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new StandardStreamOutEvent(NORMAL_RUN, 1L, "msg",
null));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory, times(1)).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -414,7 +414,7 @@ public void shouldReceiveStdOutNewLine() {
NotifiableTestStream notifiableTestStream =
mock(NotifiableTestStream.class);
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new StandardStreamOutWithNewLineEvent(NORMAL_RUN,
1L, "msg", null));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory, times(1)).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -440,7 +440,7 @@ public void shouldReceiveStdErr() {
NotifiableTestStream notifiableTestStream =
mock(NotifiableTestStream.class);
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new StandardStreamErrEvent(NORMAL_RUN, 1L, "msg",
null));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory, times(1)).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -466,7 +466,7 @@ public void shouldReceiveStdErrNewLine() {
NotifiableTestStream notifiableTestStream =
mock(NotifiableTestStream.class);
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new StandardStreamErrWithNewLineEvent(NORMAL_RUN,
1L, "msg", null));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory, times(1)).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -492,7 +492,7 @@ public void shouldLogConsoleError() {
new DeserializedStacktraceWriter("Listening for transport
dt_socket at address: 5005", null, null);
Event event = new ConsoleErrorEvent(stackTrace);
client.handleEvent(event);
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory, times(1)).createTestReportListener();
verify(factory, times(1)).getReportsDirectory();
verifyNoMoreInteractions(factory);
@@ -555,7 +555,7 @@ public void shouldLogConsoleWarning() {
NotifiableTestStream notifiableTestStream =
mock(NotifiableTestStream.class);
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new ConsoleWarningEvent("s1"));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory, times(1)).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -581,7 +581,7 @@ public void shouldLogConsoleDebug() {
NotifiableTestStream notifiableTestStream =
mock(NotifiableTestStream.class);
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new ConsoleDebugEvent("s1"));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory, times(1)).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -607,7 +607,7 @@ public void shouldLogConsoleInfo() {
NotifiableTestStream notifiableTestStream =
mock(NotifiableTestStream.class);
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new ConsoleInfoEvent("s1"));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory, times(1)).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -633,8 +633,8 @@ public void shouldSendSystemProperty() {
NotifiableTestStream notifiableTestStream =
mock(NotifiableTestStream.class);
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new SystemPropertyEvent(NORMAL_RUN, 1L, "k1",
"v1"));
- verifyZeroInteractions(notifiableTestStream);
- verifyZeroInteractions(factory);
+ verifyNoInteractions(notifiableTestStream);
+ verifyNoInteractions(factory);
assertThat(client.getReporter()).isNotNull();
assertThat(receiver.getEvents()).isEmpty();
assertThat(receiver.getData()).isEmpty();
@@ -769,7 +769,7 @@ public void shouldSendTestsetStarting() {
client.handleEvent(new TestsetStartingEvent(reportEntry));
client.tryToTimeout(System.currentTimeMillis(), 1);
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -849,7 +849,7 @@ public void shouldSendTestsetCompleted() {
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new TestsetCompletedEvent(reportEntry));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -929,7 +929,7 @@ public void shouldSendTestStarting() {
ForkClient client = new ForkClient(factory, notifiableTestStream, 0);
client.handleEvent(new TestStartingEvent(reportEntry));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.hasTestsInProgress()).isTrue();
@@ -1015,7 +1015,7 @@ public void shouldSendTestSucceeded() {
client.handleEvent(new TestSucceededEvent(reportEntry));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -1103,7 +1103,7 @@ public void shouldSendTestFailed() {
client.handleEvent(new TestFailedEvent(reportEntry));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -1195,7 +1195,7 @@ public void shouldSendTestSkipped() {
client.handleEvent(new TestSkippedEvent(reportEntry));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -1286,7 +1286,7 @@ public void shouldSendTestError() {
client.handleEvent(new TestErrorEvent(reportEntry));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
@@ -1375,7 +1375,7 @@ public void shouldSendTestAssumptionFailure() {
client.handleEvent(new TestAssumptionFailureEvent(reportEntry));
- verifyZeroInteractions(notifiableTestStream);
+ verifyNoInteractions(notifiableTestStream);
verify(factory).createTestReportListener();
verifyNoMoreInteractions(factory);
assertThat(client.getReporter()).isNotNull();
diff --git
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java
index 8e93b7500..b1c7c5539 100644
---
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java
+++
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java
@@ -42,7 +42,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
/**
@@ -117,7 +117,7 @@ public Object answer(InvocationOnMock invocation) throws
IOException {
assertThat(streamFeeder.getException()).isNull();
- verifyZeroInteractions(logger);
+ verifyNoInteractions(logger);
}
@Test
@@ -141,6 +141,6 @@ public Object answer(InvocationOnMock invocation) throws
IOException {
assertThat(streamFeeder.getException()).isNotNull().isInstanceOf(IOException.class);
- verifyZeroInteractions(logger);
+ verifyNoInteractions(logger);
}
}
diff --git a/pom.xml b/pom.xml
index 11a18c76a..a0d0a9ee0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -227,18 +227,10 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>3.12.4</version>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-inline</artifactId>
- <version>3.12.4</version>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-junit-jupiter</artifactId>
- <version>3.12.4</version>
+ <artifactId>mockito-bom</artifactId>
+ <version>4.11.0</version>
+ <type>pom</type>
+ <scope>import</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
diff --git
a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
index 971a271b4..a30adb1a9 100644
---
a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
+++
b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
@@ -74,7 +74,6 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
/**
@@ -229,7 +228,7 @@ public void displayNamesInClassAndMethods() throws
Exception {
assertThat(report.getValue().getSourceText()).isNull();
assertThat(report.getValue().getName()).isNull();
assertThat(report.getValue().getSystemProperties()).isEmpty();
- verifyZeroInteractions(listener);
+ verifyNoMoreInteractions(listener);
adapter.executionStarted(TestIdentifier.from(child1));
report = ArgumentCaptor.forClass(SimpleReportEntry.class);