whbing commented on code in PR #4448:
URL: https://github.com/apache/ozone/pull/4448#discussion_r1217497542
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestObjectGet.java:
##########
@@ -224,4 +227,26 @@ private void setDefaultHeader() {
doReturn(CONTENT_ENCODING1)
.when(headers).getHeaderString("Content-Encoding");
}
+
+ @Test
+ public void testGetWhenKeyIsDirectoryAndDoesNotEndWithASlash()
+ throws IOException {
+ // GIVEN
+ final String bucketName = "b1";
+ final String keyPath = "keyDir";
+ OzoneConfiguration config = new OzoneConfiguration();
+ config.set(OZONE_S3G_FSO_DIRECTORY_CREATION_ENABLED, "true");
+ rest.setOzoneConfiguration(config);
+ OzoneBucket bucket = client.getObjectStore().getS3Bucket(bucketName);
+ bucket.createDirectory(keyPath);
+
+ // WHEN
+ final OS3Exception ex =
+ Assertions.assertThrows(OS3Exception.class,
+ () -> rest.get(bucketName, keyPath, null, 0, null, body));
Review Comment:
variable `body` not found in my env (pull from master branch and merged this
pr). I'm not sure where is `body` defined.
--
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]