@@ -855,15 +855,22 @@ public void testCreateSameFile() throws Exception {
855
855
.isTrue ();
856
856
}
857
857
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
+ */
858
866
@ Test
859
867
public void testCreationWithoutConditionalOverwrite ()
860
- throws Throwable {
868
+ throws Exception {
861
869
final AzureBlobFileSystem currentFs = getFileSystem ();
862
870
Configuration config = new Configuration (this .getRawConfiguration ());
863
871
config .set ("fs.azure.enable.conditional.create.overwrite" ,
864
872
String .valueOf (false ));
865
873
AzureBlobFileSystemStore store = currentFs .getAbfsStore ();
866
- AbfsClient client = store .getClientHandler ().getIngressClient ();
867
874
868
875
final AzureBlobFileSystem fs =
869
876
(AzureBlobFileSystem ) FileSystem .newInstance (currentFs .getUri (),
@@ -872,15 +879,22 @@ public void testCreationWithoutConditionalOverwrite()
872
879
intercept (IOException .class , () -> fs .create (new Path ("a/b/c" ), true ));
873
880
}
874
881
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
+ */
875
890
@ Test
876
891
public void testCreationOverwriteFalseWithoutConditionalOverwrite ()
877
- throws Throwable {
892
+ throws Exception {
878
893
final AzureBlobFileSystem currentFs = getFileSystem ();
879
894
Configuration config = new Configuration (this .getRawConfiguration ());
880
895
config .set ("fs.azure.enable.conditional.create.overwrite" ,
881
896
String .valueOf (false ));
882
897
AzureBlobFileSystemStore store = currentFs .getAbfsStore ();
883
- AbfsClient client = store .getClientHandler ().getIngressClient ();
884
898
885
899
final AzureBlobFileSystem fs =
886
900
(AzureBlobFileSystem ) FileSystem .newInstance (currentFs .getUri (),
0 commit comments