priyeshkaratha commented on code in PR #10156:
URL: https://github.com/apache/ozone/pull/10156#discussion_r3159744048


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/snapshot/TestOMSnapshotRenameRequest.java:
##########
@@ -87,6 +92,21 @@ public void testPreExecute(String toSnapshotName) throws 
Exception {
     doPreExecute(omRequest);
   }
 
+  @Test
+  public void testPreExecuteFailsWhenSnapshotRenameNotAllowed() {
+    assertFalse(OMConfigKeys.OZONE_OM_SNAPSHOT_RENAME_ALLOWED_DEFAULT);
+    getOzoneManager().getConfiguration().unset(
+        OMConfigKeys.OZONE_OM_SNAPSHOT_RENAME_ALLOWED_KEY);
+
+    OzoneManagerProtocolProtos.OMRequest omRequest = renameSnapshotRequest(
+        getVolumeName(), getBucketName(), snapshotName1, snapshotName2);
+    OMException omException = assertThrows(OMException.class,
+        () -> doPreExecute(omRequest));
+    assertEquals(FEATURE_NOT_ENABLED, omException.getResult());
+    assertEquals("Ozone snapshot rename feature is not allowed per Ozone 
Manager server config",

Review Comment:
   exception message mismatch. OMSnapshotRenameRequest throws the new 
FEATURE_NOT_ENABLED exception with a trailing period, but the new tests assert 
the message without 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