InvisibleProgrammer commented on code in PR #4707:
URL: https://github.com/apache/hive/pull/4707#discussion_r1344253976


##########
ql/src/test/org/apache/hadoop/hive/ql/exec/repl/TestAtlasDumpTask.java:
##########
@@ -223,36 +222,39 @@ public void testAtlasServerEntityRetryExhausted() throws 
AtlasServiceException {
       Assert.assertTrue(atlasServiceException == ex.getCause());
     }
     ArgumentCaptor<String> getServerReqCaptor = 
ArgumentCaptor.forClass(String.class);
-    Mockito.verify(atlasClientV2, 
Mockito.times(4)).getServer(getServerReqCaptor.capture());
+    verify(atlasClientV2, times(4)).getServer(getServerReqCaptor.capture());
   }
 
   @Test
   public void testAtlasClientTimeouts() throws Exception {
-    
when(conf.getTimeVar(HiveConf.ConfVars.REPL_EXTERNAL_CLIENT_CONNECT_TIMEOUT,
-            TimeUnit.MILLISECONDS)).thenReturn(20L);
-    when(conf.getTimeVar(HiveConf.ConfVars.REPL_ATLAS_CLIENT_READ_TIMEOUT, 
TimeUnit.MILLISECONDS)).thenReturn(500L);
-    mockStatic(UserGroupInformation.class);
-    
when(UserGroupInformation.getLoginUser()).thenReturn(mock(UserGroupInformation.class));
-    mockStatic(ConfigurationConverter.class);
-    
when(ConfigurationConverter.getConfiguration(Mockito.any(Properties.class))).thenCallRealMethod();
-    AtlasRestClientBuilder atlasRestCleintBuilder = new 
AtlasRestClientBuilder("http://localhost:31000";);
-    AtlasRestClient atlasClient = atlasRestCleintBuilder.getClient(conf);
-    Assert.assertTrue(atlasClient != null);
-    ArgumentCaptor<Properties> propsCaptor = 
ArgumentCaptor.forClass(Properties.class);
-    PowerMockito.verifyStatic(ConfigurationConverter.class, Mockito.times(1));
-    ConfigurationConverter.getConfiguration(propsCaptor.capture());
-    Assert.assertEquals("20", propsCaptor.getValue().getProperty(
-            AtlasRestClientBuilder.ATLAS_PROPERTY_CONNECT_TIMEOUT_IN_MS));
-    Assert.assertEquals("500", propsCaptor.getValue().getProperty(
-            AtlasRestClientBuilder.ATLAS_PROPERTY_READ_TIMEOUT_IN_MS));
+    try (
+            MockedStatic<UserGroupInformation> 
userGroupInformationMockedStatic = mockStatic(UserGroupInformation.class);
+            MockedStatic<ConfigurationConverter> 
configurationConverterMockedStatic = mockStatic(ConfigurationConverter.class)
+            ) {

Review Comment:
   Modified. 



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to