cnauroth commented on code in PR #8207:
URL: https://github.com/apache/hadoop/pull/8207#discussion_r2743552733


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestWasbInitFailure.java:
##########
@@ -0,0 +1,52 @@
+package org.apache.hadoop.fs.azure;
+
+import java.net.URI;
+
+import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+
+import static org.apache.hadoop.test.LambdaTestUtils.intercept;
+
+/**
+ * Test to verify WASB initialization fails as expected.
+ */
+public class TestWasbInitFailure {
+
+  /**
+   * Test that initialization of Non-secure WASB FileSystem fails as expected.
+   * @throws Exception on any failure
+   */
+  @Test
+  public void testWasbInitFails() throws Exception {
+    URI wasbUri = URI.create("wasb://[email protected]");
+    assertFailure(wasbUri);
+  }
+
+  /**
+   * Test that initialization of Secure WASB FileSystem fails as expected.
+   * @throws Exception on any failure
+   */
+  @Test
+  public void testSecureWasbInitFails() throws Exception {
+    URI wasbUri = 
URI.create("wasbs://[email protected]");
+    assertFailure(wasbUri);
+  }
+
+  private void assertFailure(URI uri) throws Exception {
+    Configuration conf = new Configuration();
+    IllegalArgumentException ex = intercept(IllegalArgumentException.class, () 
-> {
+      FileSystem.newInstance(uri, conf).close();
+    });
+    Assertions.assertThat(ex.getMessage())
+        .contains("WASB Driver using wasb(s) schema is No longer Supported.");

Review Comment:
   Do these assertions pass now? There was earlier code review feedback to fix 
capitalization ("is no longer supported"), but it wasn't changed here.



-- 
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