devmadhuu commented on code in PR #7071:
URL: https://github.com/apache/ozone/pull/7071#discussion_r1721292254


##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/fsck/TestContainerHealthTask.java:
##########
@@ -384,6 +385,55 @@ public void testDeletedContainer() throws Exception {
         .isGreaterThan(currentTime);
   }
 
+  @Test
+  public void testAllContainerStateInsertions() {
+    // Set up DAOs and Schema Manager
+    UnhealthyContainersDao unHealthyContainersTableHandle =
+        getDao(UnhealthyContainersDao.class);
+
+    ContainerHealthSchemaManager containerHealthSchemaManager =
+        new ContainerHealthSchemaManager(
+            getSchemaDefinition(ContainerSchemaDefinition.class),
+            unHealthyContainersTableHandle);
+
+    // Iterate through each state in the UnHealthyContainerStates enum
+    for (ContainerSchemaDefinition.UnHealthyContainerStates state :
+        ContainerSchemaDefinition.UnHealthyContainerStates.values()) {
+      // Create a dummy UnhealthyContainer record with the current state
+      UnhealthyContainers unhealthyContainer = new UnhealthyContainers();
+      unhealthyContainer.setContainerId(state.ordinal() + 1L); // Ensure 
unique ID for each state
+      unhealthyContainer.setExpectedReplicaCount(3);
+      unhealthyContainer.setActualReplicaCount(1);
+      unhealthyContainer.setReplicaDelta(2);
+      unhealthyContainer.setContainerState(state.name());

Review Comment:
   Pls fix this comment, as it creates confusion.



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