anmolanmol1234 commented on code in PR #7272:
URL: https://github.com/apache/hadoop/pull/7272#discussion_r1908545022


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsRestOperationException.java:
##########
@@ -91,46 +104,85 @@ public void testAbfsRestOperationExceptionFormat() throws 
IOException {
     try {
       fs.listFiles(nonExistedFilePath2, false);
     } catch (Exception ex) {
-      // verify its format
       String errorMessage = ex.getLocalizedMessage();
       String[] errorFields = errorMessage.split(",");
-      // Expected Fields are: Message, StatusCode, Method, URL, 
ActivityId(rId), StorageErrorCode, StorageErrorMessage.
-      Assertions.assertThat(errorFields)
-          .describedAs("Number of Fields in exception message are not as 
expected")
-          .hasSize(7);
-      // Check status message, status code, HTTP Request Type and URL.
-      Assertions.assertThat(errorFields[0].trim())
-          .describedAs("Error Message Field in exception message is wrong")
-          .isEqualTo("Operation failed: \"The specified path does not 
exist.\"");
-      Assertions.assertThat(errorFields[1].trim())
-          .describedAs("Status Code Field in exception message"
-              + " should be \"404\"")
-          .isEqualTo("404");
-      Assertions.assertThat(errorFields[2].trim())
-          .describedAs("Http Rest Method Field in exception message"
-              + " should be \"GET\"")
-          .isEqualTo("GET");
-      Assertions.assertThat(errorFields[3].trim())
-          .describedAs("Url Field in exception message"
-              + " should start with \"http\"")
-          .startsWith("http");
-      Assertions.assertThat(errorFields[4].trim())
-          .describedAs("ActivityId Field in exception message"
-              + " should start with \"rId:\"")
-          .startsWith("rId:");
-      // Check storage error code and storage error message.
-      Assertions.assertThat(errorFields[5].trim())
-          .describedAs("StorageErrorCode Field in exception message"
-              + " should be \"PathNotFound\"")
-          .isEqualTo("PathNotFound");
-      Assertions.assertThat(errorFields[6].trim())
-          .describedAs("StorageErrorMessage Field in exception message"
-              + " should contain \"RequestId\"")
-          .contains("RequestId");
-      Assertions.assertThat(errorFields[6].trim())
-          .describedAs("StorageErrorMessage Field in exception message"
-              + " should contain \"Time\"")
-          .contains("Time");
+      if (client instanceof AbfsDfsClient) {
+        // verify its format
+        // Expected Fields are: Message, StatusCode, Method, URL, 
ActivityId(rId), StorageErrorCode, StorageErrorMessage.
+        Assertions.assertThat(errorFields)
+            .describedAs(
+                "Number of Fields in exception message are not as expected")
+            .hasSize(7);
+        Assertions.assertThat(errorFields[0].trim())
+            .describedAs("Error Message Field in exception message is wrong")
+            .isEqualTo(
+                "Operation failed: \"The specified path does not exist.\"");
+        Assertions.assertThat(errorFields[1].trim())
+            .describedAs("Status Code Field in exception message"
+                + " should be \"404\"")
+            .isEqualTo("404");
+        Assertions.assertThat(errorFields[2].trim())
+            .describedAs("Http Rest Method Field in exception message"
+                + " should be \"GET\"")
+            .isEqualTo("GET");
+        Assertions.assertThat(errorFields[3].trim())
+            .describedAs("Url Field in exception message"
+                + " should start with \"http\"")
+            .startsWith("http");
+        Assertions.assertThat(errorFields[4].trim())
+            .describedAs("ActivityId Field in exception message"
+                + " should start with \"rId:\"")
+            .startsWith("rId:");
+        // Check storage error code and storage error message.
+        Assertions.assertThat(errorFields[5].trim())
+            .describedAs("StorageErrorCode Field in exception message"
+                + " should be \"PathNotFound\"")
+            .isEqualTo("PathNotFound");
+        Assertions.assertThat(errorFields[6].trim())
+            .describedAs("StorageErrorMessage Field in exception message"
+                + " should contain \"RequestId\"")
+            .contains("RequestId");
+        Assertions.assertThat(errorFields[6].trim())
+            .describedAs("StorageErrorMessage Field in exception message"
+                + " should contain \"Time\"")
+            .contains("Time");
+      } else {

Review Comment:
   Yes on checking it's observed that the exception message thrown by List API 
on Blob and DFS endpoint is different



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