slfan1989 commented on code in PR #4695:
URL: https://github.com/apache/hadoop/pull/4695#discussion_r937314187


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestFederationInterceptorREST.java:
##########
@@ -717,4 +718,37 @@ public void testGetContainer()
         appId.toString(), appAttemptId.toString(), "0");
     Assert.assertNotNull(containerInfo);
   }
+
+  @Test
+  public void testGetAppAttempts()
+      throws IOException, InterruptedException, YarnException {
+    // Submit application to multiSubCluster
+    ApplicationId appId = ApplicationId.newInstance(Time.now(), 1);
+    ApplicationSubmissionContextInfo context = new 
ApplicationSubmissionContextInfo();
+    context.setApplicationId(appId.toString());
+
+    Assert.assertNotNull(interceptor.submitApplication(context, null));
+
+    AppAttemptsInfo appAttemptsInfo = interceptor.getAppAttempts(null, 
appId.toString());
+    Assert.assertNotNull(appAttemptsInfo);
+    Assert.assertTrue(!appAttemptsInfo.getAttempts().isEmpty());

Review Comment:
   Your suggestion is right, this part needs to be refactored, I will fix it.



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