aryangupta1998 commented on code in PR #8401:
URL: https://github.com/apache/ozone/pull/8401#discussion_r2076212043


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractRootedOzoneFileSystemTestWithFSO.java:
##########
@@ -226,4 +231,21 @@ void testLeaseRecoverable() throws Exception {
     }
   }
 
+  @Test
+  void testIsFileFalseForDir() throws IOException {
+    Path dirPath = new Path(getBucketPath(), "dir1");
+    OFSPath ofsPath = new OFSPath(dirPath, new OzoneConfiguration());
+    getFs().mkdirs(dirPath);
+
+    RootedOzoneFileSystem ofs = (RootedOzoneFileSystem) getFs();
+    BasicRootedOzoneClientAdapterImpl adapter = 
(BasicRootedOzoneClientAdapterImpl) ofs.getAdapter();
+    OzoneBucket bucket = adapter.getBucket(ofsPath, false);
+
+    Iterator<? extends OzoneKey> key = bucket.listKeys("");
+    OzoneKey ozoneKey = key.next();
+
+    assertFalse(ozoneKey.isFile());

Review Comment:
   ```suggestion
       assertTrue(key.hasNext(), "Expected dir1 in the bucket");
       OzoneKey ozoneKey = key.next();
       assertEquals("dir1", ozoneKey.getName());
       assertFalse(ozoneKey.isFile(), "Expected isFile to be false for 
directory key");
   ```



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