anujmodi2021 commented on code in PR #7312:
URL: https://github.com/apache/hadoop/pull/7312#discussion_r1928159588
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemDelegationSAS.java:
##########
@@ -213,6 +214,24 @@ public void testReadAndWrite() throws Exception {
}
}
+ @Test
+ public void checkExceptionForRenameOverwrites() throws Exception {
+ final AzureBlobFileSystem fs = getFileSystem();
+
+ Path src = new Path("a/b/f1.txt");
+ Path dest = new Path("a/b/f2.txt");
+ touch(src);
+ touch(dest);
+
+ try {
+ fs.rename(src, dest);
+ Assertions.fail("Exception expected on rename overwrites.");
+ } catch (FileAlreadyExistsException e) {
+ Assertions.assertThat(e)
Review Comment:
Nit: add a description for assert failures here and anywhere else you are
using Assertions. Something like this.
`Assertions.assertThat(e).describedAs("FileAlreadyExistsException was
expected").isInstaceOf();`
--
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]