[ 
https://issues.apache.org/jira/browse/HADOOP-19243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17884331#comment-17884331
 ] 

ASF GitHub Bot commented on HADOOP-19243:
-----------------------------------------

steveloughran commented on code in PR #6968:
URL: https://github.com/apache/hadoop/pull/6968#discussion_r1773597712


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-documentstore/src/test/java/org/apache/hadoop/yarn/server/timelineservice/documentstore/TestDocumentStoreTimelineWriterImpl.java:
##########
@@ -54,10 +58,17 @@ public void setUp() throws YarnException {
         "https://localhost:443";);
     conf.set(DocumentStoreUtils.TIMELINE_SERVICE_COSMOSDB_MASTER_KEY,
         "1234567");
-    PowerMockito.mockStatic(DocumentStoreFactory.class);
-    PowerMockito.when(DocumentStoreFactory.createDocumentStoreWriter(
-        ArgumentMatchers.any(Configuration.class)))
-        .thenReturn(documentStoreWriter);
+    mockedFactory = Mockito.mockStatic(DocumentStoreFactory.class);
+    mockedFactory.when(() -> DocumentStoreFactory.createDocumentStoreWriter(
+                    ArgumentMatchers.any(Configuration.class)))
+            .thenReturn(documentStoreWriter);
+  }
+
+  @After
+  public void tearDown() {
+    if(mockedFactory != null) {

Review Comment:
   nit: add a space



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-documentstore/src/test/java/org/apache/hadoop/yarn/server/timelineservice/documentstore/writer/cosmosdb/TestCosmosDBDocumentStoreWriter.java:
##########
@@ -28,14 +28,16 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.ArgumentMatchers;
 import org.mockito.Mockito;
-import org.powermock.api.mockito.PowerMockito;
+

Review Comment:
   no need to add a space here



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java:
##########
@@ -253,9 +253,8 @@ static long toLong(long preferredBlockSize, long 
layoutRedundancy,
 
   private BlockInfo[] blocks;
 
-  INodeFile(long id, byte[] name, PermissionStatus permissions, long mtime,
-            long atime, BlockInfo[] blklist, short replication,
-            long preferredBlockSize) {
+  public INodeFile(long id, byte[] name, PermissionStatus permissions, long 
mtime, long atime,

Review Comment:
   why this change?



##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCacheDirectives.java:
##########
@@ -1575,7 +1575,7 @@ public void testNoLookupsWhenNotUsed() throws Exception {
     CacheManager cm = cluster.getNamesystem().getCacheManager();
     LocatedBlocks locations = Mockito.mock(LocatedBlocks.class);
     cm.setCachedLocations(locations);
-    Mockito.verifyZeroInteractions(locations);

Review Comment:
   still hoping to see this to assist backports





> Upgrade Mockito version to 4.11.0
> ---------------------------------
>
>                 Key: HADOOP-19243
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19243
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Muskan Mishra
>            Assignee: Muskan Mishra
>            Priority: Major
>              Labels: pull-request-available
>
> While Compiling test classes with JDK17, faced error related to Mockito:
> *Mockito cannot mock this class.*
> So to make it compatible with jdk17 we have to upgrade the version of 
> mockito-core as well as mockito-inline.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to