You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ivandika3 (via GitHub)" <gi...@apache.org> on 2025/04/29 03:16:12 UTC
[PR] HDDS-12916. Support ETag in listObjects response [ozone]
ivandika3 opened a new pull request, #8356:
URL: https://github.com/apache/ozone/pull/8356
## What changes were proposed in this pull request?
Currently listObjects ETag field is always null although ETag has been supported for a while. This patch will support it.
Context: A user was trying to use mountpoint-s3 using goofys (https://ozone.apache.org/docs/edge/interface/csi.html) but it specifically require the ETag otherwise it will fail.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-12916
## How was this patch tested?
Update the AWS SDK V1 integration tests to check ETag, also check that keys without ETag do not throw error.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #8356:
URL: https://github.com/apache/ozone/pull/8356#issuecomment-2848401632
@sarvekshayr Thanks for the review.
> We can simplify and reduce duplication in the test by extracting common setup between testListObjectsMany() and testListObjectsManyV2() into a helper method.
I have extracted some of the duplicated logic in listObjects and listObjectsV2 tests.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on code in PR #8356:
URL: https://github.com/apache/ozone/pull/8356#discussion_r2065981554
##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/AbstractS3SDKV1Tests.java:
##########
@@ -593,19 +646,27 @@ public void testListObjectsManyV2() {
assertEquals(listObjectsResponse.getObjectSummaries().stream()
.map(S3ObjectSummary::getKey).collect(Collectors.toList()),
keyNames.subList(0, 2));
+ for (S3ObjectSummary objectSummary : listObjectsResponse.getObjectSummaries()) {
+ assertEquals(keyToEtag.get(objectSummary.getKey()), objectSummary.getETag());
+ }
assertTrue(listObjectsResponse.isTruncated());
+ // Include both keys with and without ETag
listObjectsRequest = new ListObjectsV2Request()
.withBucketName(bucketName)
- .withMaxKeys(2)
+ .withMaxKeys(5)
.withContinuationToken(listObjectsResponse.getNextContinuationToken());
listObjectsResponse = s3Client.listObjectsV2(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(1);
+ assertThat(listObjectsResponse.getObjectSummaries()).hasSize(3);
assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(2, keyNames.size()));
+ assertEquals(bucketName, listObjectsResponse.getBucketName());
Review Comment:
```suggestion
```
This line is duplicate. Please remove it.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #8356:
URL: https://github.com/apache/ozone/pull/8356#discussion_r2072364453
##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/AbstractS3SDKV1Tests.java:
##########
@@ -532,81 +532,108 @@ public void testGetObjectWithoutETag() throws Exception {
}
@Test
- public void testListObjectsMany() {
- final String bucketName = getBucketName();
- s3Client.createBucket(bucketName);
- final List<String> keyNames = Arrays.asList(
- getKeyName("1"),
- getKeyName("2"),
- getKeyName("3")
- );
-
- for (String keyName: keyNames) {
- s3Client.putObject(bucketName, keyName, RandomStringUtils.secure().nextAlphanumeric(5));
- }
-
- ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2);
- ObjectListing listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(2);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(0, 2));
- assertTrue(listObjectsResponse.isTruncated());
-
-
- listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2)
- .withMarker(listObjectsResponse.getNextMarker());
- listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(1);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(2, keyNames.size()));
- assertFalse(listObjectsResponse.isTruncated());
+ public void testListObjectsMany() throws Exception {
+ testListObjectsMany(false);
}
@Test
- public void testListObjectsManyV2() {
+ public void testListObjectsManyV2() throws Exception {
+ testListObjectsMany(true);
+ }
+
+ private void testListObjectsMany(boolean isListV2) throws Exception {
Review Comment:
Thanks for the review. Currently because `getBucketName` uses the test name as part of the bucket name, I'm expecting that the bucket name of both the list v1 and list v2 tests will be the same, causing BUCKET_ALREADY_EXISTS exception.
Generally I usually use parameterized if there are three or more different possible parameters since without parameterized test, it will be more verbose. However, in this case, adding parameterized for a simple boolean might make the test more verbose.
We can improve the parameterization in the future if needed. Let me know what you think.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #8356:
URL: https://github.com/apache/ozone/pull/8356#discussion_r2072303468
##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/AbstractS3SDKV1Tests.java:
##########
@@ -593,19 +646,27 @@ public void testListObjectsManyV2() {
assertEquals(listObjectsResponse.getObjectSummaries().stream()
.map(S3ObjectSummary::getKey).collect(Collectors.toList()),
keyNames.subList(0, 2));
+ for (S3ObjectSummary objectSummary : listObjectsResponse.getObjectSummaries()) {
+ assertEquals(keyToEtag.get(objectSummary.getKey()), objectSummary.getETag());
+ }
assertTrue(listObjectsResponse.isTruncated());
+ // Include both keys with and without ETag
listObjectsRequest = new ListObjectsV2Request()
.withBucketName(bucketName)
- .withMaxKeys(2)
+ .withMaxKeys(5)
.withContinuationToken(listObjectsResponse.getNextContinuationToken());
listObjectsResponse = s3Client.listObjectsV2(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(1);
+ assertThat(listObjectsResponse.getObjectSummaries()).hasSize(3);
assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(2, keyNames.size()));
+ assertEquals(bucketName, listObjectsResponse.getBucketName());
Review Comment:
Thanks for catching this. Updated.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #8356:
URL: https://github.com/apache/ozone/pull/8356#issuecomment-2848586035
Thanks @ivandika3 for the patch, @chungen0126, @peterxcli, @sarvekshayr for the review.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #8356:
URL: https://github.com/apache/ozone/pull/8356#discussion_r2072365794
##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/AbstractS3SDKV1Tests.java:
##########
@@ -532,81 +532,108 @@ public void testGetObjectWithoutETag() throws Exception {
}
@Test
- public void testListObjectsMany() {
- final String bucketName = getBucketName();
- s3Client.createBucket(bucketName);
- final List<String> keyNames = Arrays.asList(
- getKeyName("1"),
- getKeyName("2"),
- getKeyName("3")
- );
-
- for (String keyName: keyNames) {
- s3Client.putObject(bucketName, keyName, RandomStringUtils.secure().nextAlphanumeric(5));
- }
-
- ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2);
- ObjectListing listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(2);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(0, 2));
- assertTrue(listObjectsResponse.isTruncated());
-
-
- listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2)
- .withMarker(listObjectsResponse.getNextMarker());
- listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(1);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(2, keyNames.size()));
- assertFalse(listObjectsResponse.isTruncated());
+ public void testListObjectsMany() throws Exception {
+ testListObjectsMany(false);
}
@Test
- public void testListObjectsManyV2() {
+ public void testListObjectsManyV2() throws Exception {
+ testListObjectsMany(true);
+ }
+
+ private void testListObjectsMany(boolean isListV2) throws Exception {
final String bucketName = getBucketName();
s3Client.createBucket(bucketName);
final List<String> keyNames = Arrays.asList(
getKeyName("1"),
getKeyName("2"),
getKeyName("3")
);
+ final List<String> keyNamesWithoutETag = Arrays.asList(
+ getKeyName("4"),
+ getKeyName("5")
+ );
+ final Map<String, String> keyToEtag = new HashMap<>();
for (String keyName: keyNames) {
- s3Client.putObject(bucketName, keyName, RandomStringUtils.secure().nextAlphanumeric(5));
+ PutObjectResult putObjectResult = s3Client.putObject(bucketName, keyName,
+ RandomStringUtils.secure().nextAlphanumeric(5));
+ keyToEtag.put(keyName, putObjectResult.getETag());
}
+ try (OzoneClient ozoneClient = OzoneClientFactory.getRpcClient(cluster.getConf())) {
Review Comment:
@peterxcli Thanks for catching this. Updated all related codes to use `MiniOzoneCluster#newClient`
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on code in PR #8356:
URL: https://github.com/apache/ozone/pull/8356#discussion_r2072342837
##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/AbstractS3SDKV1Tests.java:
##########
@@ -532,81 +532,108 @@ public void testGetObjectWithoutETag() throws Exception {
}
@Test
- public void testListObjectsMany() {
- final String bucketName = getBucketName();
- s3Client.createBucket(bucketName);
- final List<String> keyNames = Arrays.asList(
- getKeyName("1"),
- getKeyName("2"),
- getKeyName("3")
- );
-
- for (String keyName: keyNames) {
- s3Client.putObject(bucketName, keyName, RandomStringUtils.secure().nextAlphanumeric(5));
- }
-
- ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2);
- ObjectListing listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(2);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(0, 2));
- assertTrue(listObjectsResponse.isTruncated());
-
-
- listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2)
- .withMarker(listObjectsResponse.getNextMarker());
- listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(1);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(2, keyNames.size()));
- assertFalse(listObjectsResponse.isTruncated());
+ public void testListObjectsMany() throws Exception {
+ testListObjectsMany(false);
}
@Test
- public void testListObjectsManyV2() {
+ public void testListObjectsManyV2() throws Exception {
+ testListObjectsMany(true);
+ }
+
+ private void testListObjectsMany(boolean isListV2) throws Exception {
final String bucketName = getBucketName();
s3Client.createBucket(bucketName);
final List<String> keyNames = Arrays.asList(
getKeyName("1"),
getKeyName("2"),
getKeyName("3")
);
+ final List<String> keyNamesWithoutETag = Arrays.asList(
+ getKeyName("4"),
+ getKeyName("5")
+ );
+ final Map<String, String> keyToEtag = new HashMap<>();
for (String keyName: keyNames) {
- s3Client.putObject(bucketName, keyName, RandomStringUtils.secure().nextAlphanumeric(5));
+ PutObjectResult putObjectResult = s3Client.putObject(bucketName, keyName,
+ RandomStringUtils.secure().nextAlphanumeric(5));
+ keyToEtag.put(keyName, putObjectResult.getETag());
}
+ try (OzoneClient ozoneClient = OzoneClientFactory.getRpcClient(cluster.getConf())) {
Review Comment:
```suggestion
try (OzoneClient ozoneClient = cluster.newClient())) {
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #8356:
URL: https://github.com/apache/ozone/pull/8356
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "chungen0126 (via GitHub)" <gi...@apache.org>.
chungen0126 commented on code in PR #8356:
URL: https://github.com/apache/ozone/pull/8356#discussion_r2072329802
##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/AbstractS3SDKV2Tests.java:
##########
@@ -133,6 +153,116 @@ public void testPutObject() {
assertEquals("\"37b51d194a7513e45b56f6524f2d51f2\"", getObjectResponse.eTag());
}
+ @Test
+ public void testListObjectsMany() throws Exception {
+ testListObjectsMany(false);
+ }
+
+ @Test
+ public void testListObjectsManyV2() throws Exception {
+ testListObjectsMany(true);
+ }
+
+ private void testListObjectsMany(boolean isListV2) throws Exception {
Review Comment:
Same here.
##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/AbstractS3SDKV1Tests.java:
##########
@@ -532,81 +532,108 @@ public void testGetObjectWithoutETag() throws Exception {
}
@Test
- public void testListObjectsMany() {
- final String bucketName = getBucketName();
- s3Client.createBucket(bucketName);
- final List<String> keyNames = Arrays.asList(
- getKeyName("1"),
- getKeyName("2"),
- getKeyName("3")
- );
-
- for (String keyName: keyNames) {
- s3Client.putObject(bucketName, keyName, RandomStringUtils.secure().nextAlphanumeric(5));
- }
-
- ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2);
- ObjectListing listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(2);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(0, 2));
- assertTrue(listObjectsResponse.isTruncated());
-
-
- listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2)
- .withMarker(listObjectsResponse.getNextMarker());
- listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(1);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(2, keyNames.size()));
- assertFalse(listObjectsResponse.isTruncated());
+ public void testListObjectsMany() throws Exception {
+ testListObjectsMany(false);
}
@Test
- public void testListObjectsManyV2() {
+ public void testListObjectsManyV2() throws Exception {
+ testListObjectsMany(true);
+ }
+
+ private void testListObjectsMany(boolean isListV2) throws Exception {
Review Comment:
Why not use @ParameterizedTest to parameterize 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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12916. Support ETag in listObjects response [ozone]
Posted by "chungen0126 (via GitHub)" <gi...@apache.org>.
chungen0126 commented on code in PR #8356:
URL: https://github.com/apache/ozone/pull/8356#discussion_r2072329195
##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/AbstractS3SDKV1Tests.java:
##########
@@ -532,81 +532,108 @@ public void testGetObjectWithoutETag() throws Exception {
}
@Test
- public void testListObjectsMany() {
- final String bucketName = getBucketName();
- s3Client.createBucket(bucketName);
- final List<String> keyNames = Arrays.asList(
- getKeyName("1"),
- getKeyName("2"),
- getKeyName("3")
- );
-
- for (String keyName: keyNames) {
- s3Client.putObject(bucketName, keyName, RandomStringUtils.secure().nextAlphanumeric(5));
- }
-
- ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2);
- ObjectListing listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(2);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(0, 2));
- assertTrue(listObjectsResponse.isTruncated());
-
-
- listObjectsRequest = new ListObjectsRequest()
- .withBucketName(bucketName)
- .withMaxKeys(2)
- .withMarker(listObjectsResponse.getNextMarker());
- listObjectsResponse = s3Client.listObjects(listObjectsRequest);
- assertThat(listObjectsResponse.getObjectSummaries()).hasSize(1);
- assertEquals(bucketName, listObjectsResponse.getBucketName());
- assertEquals(listObjectsResponse.getObjectSummaries().stream()
- .map(S3ObjectSummary::getKey).collect(Collectors.toList()),
- keyNames.subList(2, keyNames.size()));
- assertFalse(listObjectsResponse.isTruncated());
+ public void testListObjectsMany() throws Exception {
+ testListObjectsMany(false);
}
@Test
- public void testListObjectsManyV2() {
+ public void testListObjectsManyV2() throws Exception {
+ testListObjectsMany(true);
+ }
+
+ private void testListObjectsMany(boolean isListV2) throws Exception {
Review Comment:
Could we use @ParameterizedTest to parameterize 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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org