[
https://issues.apache.org/jira/browse/YARN-11261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17602757#comment-17602757
]
ASF GitHub Bot commented on YARN-11261:
---------------------------------------
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())`
> Upgrade JUnit from 4 to 5 in hadoop-yarn-server-web-proxy
> ---------------------------------------------------------
>
> Key: YARN-11261
> URL: https://issues.apache.org/jira/browse/YARN-11261
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: yarn
> Affects Versions: 3.3.4
> Reporter: groot
> Assignee: groot
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]