Skip to content

Commit 369a52e

Browse files
add javadocs for new tests
1 parent 356b64a commit 369a52e

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -855,15 +855,22 @@ public void testCreateSameFile() throws Exception {
855855
.isTrue();
856856
}
857857

858+
/**
859+
* Test the creation of a file without conditional overwrite.
860+
* This test sets the configuration `fs.azure.enable.conditional.create.overwrite` to false,
861+
* creates a directory, and then attempts to create a file at the same path with overwrite set to true.
862+
* It expects an IOException to be thrown.
863+
*
864+
* @throws Exception if any exception occurs during the test execution
865+
*/
858866
@Test
859867
public void testCreationWithoutConditionalOverwrite()
860-
throws Throwable {
868+
throws Exception {
861869
final AzureBlobFileSystem currentFs = getFileSystem();
862870
Configuration config = new Configuration(this.getRawConfiguration());
863871
config.set("fs.azure.enable.conditional.create.overwrite",
864872
String.valueOf(false));
865873
AzureBlobFileSystemStore store = currentFs.getAbfsStore();
866-
AbfsClient client = store.getClientHandler().getIngressClient();
867874

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

882+
/**
883+
* Test the creation of a file with overwrite set to false without conditional overwrite.
884+
* This test sets the configuration `fs.azure.enable.conditional.create.overwrite` to false,
885+
* creates a directory, and then attempts to create a file at the same path with overwrite set to false.
886+
* It expects an IOException to be thrown.
887+
*
888+
* @throws Exception if any exception occurs during the test execution
889+
*/
875890
@Test
876891
public void testCreationOverwriteFalseWithoutConditionalOverwrite()
877-
throws Throwable {
892+
throws Exception {
878893
final AzureBlobFileSystem currentFs = getFileSystem();
879894
Configuration config = new Configuration(this.getRawConfiguration());
880895
config.set("fs.azure.enable.conditional.create.overwrite",
881896
String.valueOf(false));
882897
AzureBlobFileSystemStore store = currentFs.getAbfsStore();
883-
AbfsClient client = store.getClientHandler().getIngressClient();
884898

885899
final AzureBlobFileSystem fs =
886900
(AzureBlobFileSystem) FileSystem.newInstance(currentFs.getUri(),

0 commit comments

Comments
 (0)