ChenSammi commented on code in PR #11461:
URL: https://github.com/apache/ozone/pull/11461#discussion_r4255935810
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestS3LifecycleConfigurationPut.java:
##########
@@ -917,6 +922,183 @@ public void
testPutLifecycleMatchingOwnerStillValidatesXml() throws Exception {
verify(proxy, never()).setLifecycleConfiguration(any());
}
+ @ParameterizedTest
+ @MethodSource("versioningActions")
+ public void testRejectVersioningActions(String action, String status,
boolean namespace) throws Exception {
+ ClientProtocol proxy = mock(ClientProtocol.class);
+ BucketEndpoint endpoint = newProtocolEndpoint(proxy, headers,
BucketLayout.OBJECT_STORE);
+ String xml = "<LifecycleConfiguration" + (namespace ? " xmlns=\"" +
S3Consts.S3_XML_NAMESPACE + "\"" : "")
+ + "><Rule><ID>versioning</ID><Prefix>prefix/</Prefix><Status>" +
status + "</Status>"
+ +
"<AbortIncompleteMultipartUpload><DaysAfterInitiation>1</DaysAfterInitiation>"
+ + "</AbortIncompleteMultipartUpload>" + action +
"</Rule></LifecycleConfiguration>";
+ assertErrorResponse(MALFORMED_XML,
Review Comment:
I have a general comment for error assert for all the new unit tests.
Besides, assert the MALFORMED_XML error code, let's also assert the returned
error message has the expected action/field name which is either not supported
or invalid.
--
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]