Skip to content

Commit

Permalink
add javadocs for new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolanmol1234 committed Feb 5, 2025
1 parent 356b64a commit 369a52e
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -855,15 +855,22 @@ public void testCreateSameFile() throws Exception {
.isTrue();
}

/**
* Test the creation of a file without conditional overwrite.
* This test sets the configuration `fs.azure.enable.conditional.create.overwrite` to false,
* creates a directory, and then attempts to create a file at the same path with overwrite set to true.
* It expects an IOException to be thrown.
*
* @throws Exception if any exception occurs during the test execution
*/
@Test
public void testCreationWithoutConditionalOverwrite()
throws Throwable {
throws Exception {
final AzureBlobFileSystem currentFs = getFileSystem();
Configuration config = new Configuration(this.getRawConfiguration());
config.set("fs.azure.enable.conditional.create.overwrite",
String.valueOf(false));
AzureBlobFileSystemStore store = currentFs.getAbfsStore();
AbfsClient client = store.getClientHandler().getIngressClient();

final AzureBlobFileSystem fs =
(AzureBlobFileSystem) FileSystem.newInstance(currentFs.getUri(),
Expand All @@ -872,15 +879,22 @@ public void testCreationWithoutConditionalOverwrite()
intercept(IOException.class, () -> fs.create(new Path("a/b/c"), true));
}

/**
* Test the creation of a file with overwrite set to false without conditional overwrite.
* This test sets the configuration `fs.azure.enable.conditional.create.overwrite` to false,
* creates a directory, and then attempts to create a file at the same path with overwrite set to false.
* It expects an IOException to be thrown.
*
* @throws Exception if any exception occurs during the test execution
*/
@Test
public void testCreationOverwriteFalseWithoutConditionalOverwrite()
throws Throwable {
throws Exception {
final AzureBlobFileSystem currentFs = getFileSystem();
Configuration config = new Configuration(this.getRawConfiguration());
config.set("fs.azure.enable.conditional.create.overwrite",
String.valueOf(false));
AzureBlobFileSystemStore store = currentFs.getAbfsStore();
AbfsClient client = store.getClientHandler().getIngressClient();

final AzureBlobFileSystem fs =
(AzureBlobFileSystem) FileSystem.newInstance(currentFs.getUri(),
Expand Down

0 comments on commit 369a52e

Please sign in to comment.