anuragp010 commented on code in PR #11171:
URL: https://github.com/apache/ozone/pull/11171#discussion_r3922870852


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java:
##########
@@ -163,6 +164,19 @@ public void setup() throws Exception {
     omMetadataManager = new OmMetadataManagerImpl(ozoneConfiguration, null);
   }
 
+  @Test
+  public void testGetMissingLifecycleConfigurationIsNotLoggedAsError() throws 
Exception {
+    try (LogCapturer logCapturer = 
LogCapturer.captureLogs(OmMetadataManagerImpl.class)) {
+      OMException ex = assertThrows(OMException.class, () ->
+          omMetadataManager.getLifecycleConfiguration("volume1", "bucket1"));
+
+      assertEquals(ResultCodes.LIFECYCLE_CONFIGURATION_NOT_FOUND, 
ex.getResult());
+      // A bucket without a lifecycle configuration is an expected outcome, so 
the
+      // catch-all must not report it with an error and a stack trace.
+      assertFalse(logCapturer.getOutput().contains("Exception while getting 
lifecycle configuration"));

Review Comment:
   nit: Would it be better to use `assertThat` instead of `assertFalse`? 
(Refer: [HDDS-9951](https://issues.apache.org/jira/browse/HDDS-9951))



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