smengcl commented on code in PR #11426:
URL: https://github.com/apache/ozone/pull/11426#discussion_r4255341496
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestBucketList.java:
##########
@@ -669,6 +672,85 @@ public void continuationTokenXmlElementName() throws
Exception {
"response must not use the non-AWS <continueToken> element");
}
+ @Test
+ public void listObjectVersionsReturnsNullVersionOfEachKey() throws
OS3Exception, IOException {
+ setup("dir1/file2", "file+1", "file3");
+
+ bucketEndpoint.queryParamsForTest().set(QueryParams.VERSIONS, "");
+ bucketEndpoint.queryParamsForTest().set(QueryParams.DELIMITER, "/");
+ bucketEndpoint.queryParamsForTest().set(QueryParams.ENCODING_TYPE,
ENCODING_TYPE);
+ ListVersionsResult result = (ListVersionsResult)
bucketEndpoint.get(BUCKET_NAME).getEntity();
+
+ assertThat(result.isTruncated()).isFalse();
+ assertThat(result.getNextKeyMarker()).isNull();
+ assertThat(result.getNextVersionIdMarker()).isNull();
+ assertThat(result.getCommonPrefixes()).extracting(p ->
p.getPrefix().getName()).containsExactly("dir1/");
+ assertThat(result.getVersions()).extracting(v ->
v.getKey().getName()).containsExactly("file+1", "file3");
+ assertThat(result.getVersions()).allSatisfy(v -> {
+ assertThat(v.getVersionId()).isEqualTo(NULL_VERSION_ID);
+ assertThat(v.getIsLatest()).isTrue();
+ assertThat(v.getOwner()).isNotNull();
+ });
+
+ StringWriter writer = new StringWriter();
+ JAXB.marshal(result, writer);
+ assertThat(writer.toString())
Review Comment:
Done in d4f0fedaad5. The test now compares the full marshalled document.
`LastModified` and the owner name and ID are masked because they depend on
the time and on the user running the test.
--
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]