aajisaka commented on code in PR #4777:
URL: https://github.com/apache/hadoop/pull/4777#discussion_r967691879


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestSecureAmFilter.java:
##########
@@ -88,11 +89,11 @@ public static void setUp() {
       testMiniKDC = new MiniKdc(MiniKdc.createConf(), TEST_ROOT_DIR);
       setupKDC();
     } catch (Exception e) {
-      assertTrue("Couldn't create MiniKDC", false);
+      assertTrue(false, "Couldn't create MiniKDC");

Review Comment:
   Here, we should use `fail("Couldn't create MiniKDC");`
   
https://junit.org/junit5/docs/5.8.2/api/org.junit.jupiter.api/org/junit/jupiter/api/Assertions.html#fail(java.lang.String)



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestAppReportFetcher.java:
##########
@@ -63,29 +66,29 @@ public void testHelper(boolean isAHSEnabled)
   }
 
   @Test
-  public void testFetchReportAHSEnabled() throws YarnException, IOException {
+  void testFetchReportAHSEnabled() throws YarnException, IOException {
     testHelper(true);
     Mockito.verify(historyManager, Mockito.times(1))
-    .getApplicationReport(Mockito.any(GetApplicationReportRequest.class));
+        .getApplicationReport(Mockito.any(GetApplicationReportRequest.class));
     Mockito.verify(appManager, Mockito.times(1))
-    .getApplicationReport(Mockito.any(GetApplicationReportRequest.class));
+        .getApplicationReport(Mockito.any(GetApplicationReportRequest.class));
   }
 
   @Test
-  public void testFetchReportAHSDisabled() throws YarnException, IOException {
+  void testFetchReportAHSDisabled() throws YarnException, IOException {
     try {
       testHelper(false);
     } catch (ApplicationNotFoundException e) {
-      Assert.assertTrue(e.getMessage() == appNotFoundExceptionMsg);
+      assertTrue(e.getMessage() == appNotFoundExceptionMsg);

Review Comment:
   We can refactor as `assertEquals(appNotFoundExceptionMsg, e.getMessage())`



-- 
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]

Reply via email to