From 66132e07625dcac3afd299c25214e67c7f1a621e Mon Sep 17 00:00:00 2001 From: Raghav Aggarwal Date: Fri, 31 Jul 2026 21:26:17 +0530 Subject: [PATCH] TEZ-4747: Upgrade mockito to 5.23.0 --- pom.xml | 2 +- .../src/test/java/org/apache/tez/client/TestTezClient.java | 4 ++-- .../history/logging/ats/TestATSHistoryLoggingService.java | 5 +++-- .../apache/tez/runtime/api/impl/TestProcessorContext.java | 2 +- .../tez/runtime/library/common/shuffle/TestShuffleUtils.java | 5 ++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index fec11d4d7c..c2cd1d448e 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 1.8 1.0.0 3.1.0 - 4.8.1 + 5.23.0 4.1.130.Final 0.13.0 3.25.5 diff --git a/tez-api/src/test/java/org/apache/tez/client/TestTezClient.java b/tez-api/src/test/java/org/apache/tez/client/TestTezClient.java index 402c7a545e..9ffc71d0f4 100644 --- a/tez-api/src/test/java/org/apache/tez/client/TestTezClient.java +++ b/tez-api/src/test/java/org/apache/tez/client/TestTezClient.java @@ -382,7 +382,7 @@ public void testGetClient() throws Exception { client2.stop(); verify(client2.sessionAmProxy, times(1)).shutdownSession(any(), any()); - verify(client2.mockYarnClient, times(1)).stop(); + verify(client2.mockYarnClient, times(1)).close(); /* END reuse of AM from new TezClient */ } @@ -501,7 +501,7 @@ public TezClientForTest testTezClient(boolean isSession, boolean shouldStop, Str verify(client.sessionAmProxy, times(1)).shutdownSession(any(), any()); } - verify(client.mockYarnClient, times(1)).stop(); + verify(client.mockYarnClient, times(1)).close(); } return client; } diff --git a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryLoggingService.java b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryLoggingService.java index 7a863ac6e2..9596e0e6a8 100644 --- a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryLoggingService.java +++ b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryLoggingService.java @@ -39,6 +39,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.NodeId; +import org.apache.hadoop.yarn.api.records.timeline.TimelineEntity; import org.apache.hadoop.yarn.client.api.TimelineClient; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.util.SystemClock; @@ -103,7 +104,7 @@ public void setup() throws Exception { when(appContext.getCurrentDAGID()).thenReturn(null); when(appContext.getApplicationID()).thenReturn(appId); when(atsHistoryLoggingService.timelineClient.putEntities( - any())).thenAnswer( + any(TimelineEntity[].class))).thenAnswer( new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { @@ -188,7 +189,7 @@ public void testTimelineServiceDisable() throws Exception { atsHistoryLoggingService1.setAppContext(appContext); atsHistoryLoggingService1.timelineClient = mock(TimelineClient.class); - when(atsHistoryLoggingService1.timelineClient.putEntities(any())).thenAnswer( + when(atsHistoryLoggingService1.timelineClient.putEntities(any(TimelineEntity[].class))).thenAnswer( new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { diff --git a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/api/impl/TestProcessorContext.java b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/api/impl/TestProcessorContext.java index 2a0bbf4b31..900c75fe97 100644 --- a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/api/impl/TestProcessorContext.java +++ b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/api/impl/TestProcessorContext.java @@ -96,7 +96,7 @@ public void testDagNumber() throws IOException { vertexParallelism, taskAttemptId, null, - runtimeTask, + mockTask, serviceConsumerMetadata, auxServiceEnv, memDist, diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/TestShuffleUtils.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/TestShuffleUtils.java index 1891cf4609..2329a4f088 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/TestShuffleUtils.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/TestShuffleUtils.java @@ -81,7 +81,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentMatchers; import org.slf4j.Logger; public class TestShuffleUtils { @@ -398,14 +397,14 @@ public void testFetchStatsLogger() throws Exception { logger.logIndividualFetchComplete(10, 100, 1000, "testType", ident); } verify(activeLogger, times(0)).info(anyString()); - verify(aggregateLogger, times(1)).info(anyString(), ArgumentMatchers.any()); + verify(aggregateLogger, times(1)).info(anyString(), any(), any(), any(), any(), any()); when(activeLogger.isInfoEnabled()).thenReturn(true); for (int i = 0; i < 1000; i++) { logger.logIndividualFetchComplete(10, 100, 1000, "testType", ident); } verify(activeLogger, times(1000)).info(anyString()); - verify(aggregateLogger, times(1)).info(anyString(), ArgumentMatchers.any()); + verify(aggregateLogger, times(1)).info(anyString(), any(), any(), any(), any(), any()); } /**