bhattmanish98 commented on code in PR #7386:
URL: https://github.com/apache/hadoop/pull/7386#discussion_r1979066104


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemRename.java:
##########
@@ -304,12 +324,67 @@ public void testRenameNotFoundBlobToEmptyRoot() throws 
Exception {
    *
    * @throws Exception if an error occurs during test execution
    */
-  @Test(expected = IOException.class)
-  public void testRenameBlobToDstWithColonInPath() throws Exception {
+  @Test
+  public void testRenameBlobToDstWithColonInSourcePath() throws Exception {
     AzureBlobFileSystem fs = getFileSystem();
     assumeBlobServiceType();
+    fs.create(new Path("/src:/file"));
+    Assertions.assertThat(
+        fs.rename(new Path("/src:"),
+            new Path("/dst"))
+    ).isTrue();
+  }
+
+  /**
+   * Tests renaming a source path to a destination path that contains a colon 
in the path.
+   * This verifies that the rename operation handles paths with special 
characters like a colon.
+   *
+   * The test creates a source directory and renames it to a destination path 
that includes a colon,
+   * ensuring that the operation succeeds without errors.
+   *
+   * @throws Exception if an error occurs during test execution
+   */
+  @Test
+  public void testRenameWithColonInDestinationPath() throws Exception {
+    AzureBlobFileSystem fs = getFileSystem();
     fs.create(new Path("/src"));
-    fs.rename(new Path("/src"), new Path("/dst:file"));
+    Assertions.assertThat(

Review Comment:
   Done!



##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemRename.java:
##########
@@ -304,12 +324,67 @@ public void testRenameNotFoundBlobToEmptyRoot() throws 
Exception {
    *
    * @throws Exception if an error occurs during test execution
    */
-  @Test(expected = IOException.class)
-  public void testRenameBlobToDstWithColonInPath() throws Exception {
+  @Test
+  public void testRenameBlobToDstWithColonInSourcePath() throws Exception {
     AzureBlobFileSystem fs = getFileSystem();
     assumeBlobServiceType();
+    fs.create(new Path("/src:/file"));
+    Assertions.assertThat(

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]

Reply via email to