F64116045 commented on code in PR #11467:
URL: https://github.com/apache/ozone/pull/11467#discussion_r4238192292


##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestBucketList.java:
##########
@@ -99,6 +99,25 @@ public void listDir() throws OS3Exception, IOException {
     assertEquals(0, getBucketResponse.getContents().size());
   }
 
+  /**
+   * Key equal to prefix + delimiter (dir/ with prefix dir) is handled by the
+   * indexOf(delimiter) branch as a common prefix. An endsWith(delimiter)
+   * fallback after indexOf < 0 is unreachable and must not be required.
+   */
+  @Test
+  public void listExactPrefixWithTrailingDelimiter() throws OS3Exception, 
IOException {
+    setup("dir/", "dir/file1", "other");

Review Comment:
   nit: I think this test does not really check the `dir/` key.
   `dir/file1` alone already gives the common prefix `dir/`, so the
   test passes even if `dir/` is removed from setup.
   
   Maybe use `setup("dir/", "other")` instead?



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