akshatb1 commented on a change in pull request #3135:
URL: https://github.com/apache/hadoop/pull/3135#discussion_r658480192
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/clientrm/TestFederationClientInterceptor.java
##########
@@ -531,4 +536,107 @@ public void testGetClusterMetricsRequest() throws
YarnException, IOException {
GetClusterMetricsResponse.class);
Assert.assertEquals(true, clusterMetrics.isEmpty());
}
+
+ /**
+ * This test validates the correctness of
+ * GetApplicationsResponse in case the
+ * application exists in the cluster.
+ */
+ @Test
+ public void testGetApplicationsResponse()
+ throws YarnException, IOException, InterruptedException {
+ LOG.info("Test FederationClientInterceptor: " +
+ "Get Applications Response");
+ ApplicationId appId =
+ ApplicationId.newInstance(System.currentTimeMillis(), 1);
+
+ SubmitApplicationRequest request = mockSubmitApplicationRequest(appId);
+ SubmitApplicationResponse response =
interceptor.submitApplication(request);
+
+ Assert.assertNotNull(response);
+ Assert.assertNotNull(stateStoreUtil.queryApplicationHomeSC(appId));
+
+ Set<String> appTypes = Collections.singleton("MockApp");
+ GetApplicationsRequest requestGet =
+ GetApplicationsRequest.newInstance(appTypes);
+
+ GetApplicationsResponse responseGet =
+ interceptor.getApplications(requestGet);
+
+ Assert.assertNotNull(responseGet);
+ }
+
+ /**
+ * This test validates
+ * the correctness of GetApplicationsResponse in case of
+ * empty request.
+ */
+ @Test
+ public void testGetApplicationsNullRequest() throws Exception {
+ LOG.info("Test FederationClientInterceptor : Get Applications request");
+ LambdaTestUtils.intercept(YarnException.class,
+ "Missing getApplications request.",
+ () -> interceptor.getApplications(null));
Review comment:
Applied Hadoop formatter. There are no errors from checkstyle plugin in
local and from Yetus.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]