amogh-jahagirdar commented on code in PR #8365:
URL: https://github.com/apache/iceberg/pull/8365#discussion_r1302123928
##########
aws/src/test/java/org/apache/iceberg/aws/s3/signer/TestS3RestSigner.java:
##########
@@ -177,6 +181,22 @@ public void validatePutObject() {
PutObjectRequest.builder().bucket(BUCKET).key("some/key").build(),
Paths.get("/etc/hosts"));
}
+ @Test
+ public void validateDeleteObjects() {
+ Path sourcePath = Paths.get("/etc/hosts");
+
s3.putObject(PutObjectRequest.builder().bucket(BUCKET).key("some/key1").build(),
sourcePath);
+
s3.putObject(PutObjectRequest.builder().bucket(BUCKET).key("some/key2").build(),
sourcePath);
+
+ Delete objectsToDelete =
+ Delete.builder()
+ .objects(
+ ObjectIdentifier.builder().key("some/key1").build(),
+ ObjectIdentifier.builder().key("some/key2").build())
+ .build();
+
+
s3.deleteObjects(DeleteObjectsRequest.builder().bucket(BUCKET).delete(objectsToDelete).build());
Review Comment:
Good idea, I think for purpose of testing we can have an internal class
`TestS3SignerServlet` which extends the `S3SignerServlet`. This servlet
implementation can accept a set of precondition predicates on the expected
request state (in our case, for POST ?delete do we actually have a body).
This implementation can override the normal post/get/put/head
implementations in the following manner:
1.) Verify the preconditions
2.) Delegate to parent super.post()/get/etc
--
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]