ArafatKhan2198 commented on code in PR #4876:
URL: https://github.com/apache/ozone/pull/4876#discussion_r1228032909
##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestContainerEndpoint.java:
##########
@@ -1268,16 +1269,74 @@ public void testGetContainerInsightsNonSCMContainers()
// delete container Id 1 from SCM
reconContainerManager.deleteContainer(ContainerID.valueOf(1));
Response containerInsights =
- containerEndpoint.getContainerMisMatchInsights();
+ containerEndpoint.getContainerMisMatchInsights(10, 0, "SCM");
+ Map<String, Object> response =
+ (Map<String, Object>) containerInsights.getEntity();
+ long prevKey = (long) response.get("prevKey");
+ assertEquals(0, prevKey);
List<ContainerDiscrepancyInfo> containerDiscrepancyInfoList =
- (List<ContainerDiscrepancyInfo>) containerInsights.getEntity();
+ (List<ContainerDiscrepancyInfo>) response.get(
+ "missingContainerList");
ContainerDiscrepancyInfo containerDiscrepancyInfo =
containerDiscrepancyInfoList.get(0);
assertEquals(1, containerDiscrepancyInfo.getContainerID());
assertEquals(1, containerDiscrepancyInfoList.size());
assertEquals("OM", containerDiscrepancyInfo.getExistsAt());
}
+
+ @Test
+ public void testGetContainerInsightsNonSCMContainersWithPrevKey()
Review Comment:
Done!
##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestContainerEndpoint.java:
##########
@@ -1296,16 +1355,113 @@ public void testGetContainerInsightsNonOMContainers()
}
});
Response containerInsights =
- containerEndpoint.getContainerMisMatchInsights();
+ containerEndpoint.getContainerMisMatchInsights(10, 0, "OM");
+ Map<String, Object> response =
+ (Map<String, Object>) containerInsights.getEntity();
List<ContainerDiscrepancyInfo> containerDiscrepancyInfoList =
- (List<ContainerDiscrepancyInfo>) containerInsights.getEntity();
+ (List<ContainerDiscrepancyInfo>) response.get("missingContainerList");
ContainerDiscrepancyInfo containerDiscrepancyInfo =
containerDiscrepancyInfoList.get(0);
assertEquals(2, containerDiscrepancyInfo.getContainerID());
assertEquals(1, containerDiscrepancyInfoList.size());
assertEquals("SCM", containerDiscrepancyInfo.getExistsAt());
}
+ @Test
+ public void testGetContainerInsightsNonOMContainersWithPrevKey()
Review Comment:
Done!
--
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]