steveloughran commented on code in PR #5273:
URL: https://github.com/apache/hadoop/pull/5273#discussion_r1302010099
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestCGroupsHandlerImpl.java:
##########
@@ -192,7 +192,7 @@ public void testMountController() throws IOException {
assertTrue("cgroup dir should be cerated", cgroup.mkdirs());
//Since we enabled (deferred) cgroup controller mounting, no interactions
//should have occurred, with this mock
- verifyZeroInteractions(privilegedOperationExecutorMock);
+ Mockito.verifyNoInteractions(privilegedOperationExecutorMock);
Review Comment:
use static import for consistency with the others.
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpcMultiDestination.java:
##########
@@ -24,7 +24,6 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
Review Comment:
reinstate so this file doesn't change
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpcMultiDestination.java:
##########
@@ -423,7 +423,7 @@ public void testSubclusterDown() throws Exception {
FSNamesystem ns0 = nn0.getNamesystem();
HAContext nn0haCtx = (HAContext)getInternalState(ns0, "haContext");
HAContext mockCtx = mock(HAContext.class);
- doThrow(new StandbyException("Mock")).when(mockCtx).checkOperation(any());
+ doThrow(new
StandbyException("Mock")).when(mockCtx).checkOperation(Mockito.any());
Review Comment:
return to the existing any() static import
##########
hadoop-project/pom.xml:
##########
@@ -1308,7 +1308,20 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>2.28.2</version>
+ <version>4.11.0</version>
Review Comment:
add a new property mockito.version and reference in both places
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/gpu/TestGpuResourceAllocator.java:
##########
@@ -210,7 +210,7 @@ private void assertAllocatedGpus(int gpus, int deniedGpus,
private void assertNoAllocation(GpuAllocation allocation) {
assertEquals(1, allocation.getDeniedGPUs().size());
assertEquals(0, allocation.getAllowedGPUs().size());
- verifyZeroInteractions(nmStateStore);
+ Mockito.verifyNoInteractions(nmStateStore);
Review Comment:
use static import
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]