Russole commented on code in PR #9371:
URL: https://github.com/apache/ozone/pull/9371#discussion_r2598573226


##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestBucketPut.java:
##########
@@ -51,16 +86,36 @@ public void setup() throws Exception {
     bucketEndpoint = EndpointBuilder.newBucketEndpointBuilder()
         .setClient(clientStub)
         .build();
+
+    mockHeaders = mock(HttpHeaders.class);
+    bucketEndpoint.setHeaders(mockHeaders);
   }
 
   @Test
-  public void testBucketFailWithAuthHeaderMissing() throws Exception {
-    try {
-      bucketEndpoint.put(bucketName, null, null);
-    } catch (OS3Exception ex) {
-      assertEquals(HTTP_NOT_FOUND, ex.getHttpCode());
-      assertEquals(MALFORMED_HEADER.getCode(), ex.getCode());
-    }
+  public void testAclWithMissingHeaders() throws Exception {
+    bucketEndpoint.getClient().getObjectStore().createS3Bucket(bucketName);

Review Comment:
   Because putAcl() first calls getS3Bucket(bucketName).
   If the bucket does not exist, it throws NO_SUCH_BUCKET and never reaches any 
ACL parsing logic.
   To test the ACL behavior, the bucket must already exist.



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