saxenapranav commented on code in PR #6592:
URL: https://github.com/apache/hadoop/pull/6592#discussion_r1508488832


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemAttributes.java:
##########
@@ -154,4 +149,24 @@ private void testGetSetXAttrHelper(final 
AzureBlobFileSystem fs,
         .describedAs("Retrieved Attribute Does not Matches in Decoded Form")
         .isEqualTo(decodedAttributeValue2);
   }
+
+  @Test
+  public void testGetSetXAttrOnRoot() throws Exception {
+    AzureBlobFileSystem fs = getFileSystem();
+    String attributeName = "user.attribute1";
+    byte[] attributeValue = fs.getAbfsStore().encodeAttribute("hi");
+    final Path testPath = new Path(ROOT_PATH);
+
+    try {
+      fs.getXAttr(testPath, attributeName);
+    } catch (AbfsRestOperationException e) {
+      Assertions.assertThat(e.getStatusCode()).isEqualTo(HTTP_BAD_REQUEST);

Review Comment:
   Assert will happen only if exception is thrown. We should make sure that 
exception does happen.. Lets use `LambdaTestUtils.intercept`. Similarly for the 
other setXAttr intercept



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