Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

test(s3): cover ignored multi-range requests through the SDK (#5506)

Aniket Shukla2823a15c3591
diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3Test.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3Test.java
index 34776c1bec..2ddf876aeb 100644
--- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3Test.java
+++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3Test.java
@@ -529,6 +529,18 @@ class S3Test {
assertThat(response.asUtf8String()).isEqualTo("from AWS");
assertThat(response.response().contentLength()).isEqualTo(8);
assertThat(response.response().contentRange()).isEqualTo("bytes 6-13/" + CONTENT.length());
+
+ ResponseBytes<GetObjectResponse> multiRangeResponse = s3.getObjectAsBytes(GetObjectRequest.builder()
+ .bucket(bucket)
+ .key(key)
+ .range("bytes=0-1,3-4,7-9")
+ .build());
+
+ assertThat(multiRangeResponse.response().sdkHttpResponse().statusCode()).isEqualTo(200);
+ assertThat(multiRangeResponse.asUtf8String()).isEqualTo(CONTENT);
+ assertThat(multiRangeResponse.response().contentLength()).isEqualTo(CONTENT.length());
+ assertThat(multiRangeResponse.response().contentRange()).isNull();
+ assertThat(multiRangeResponse.response().sdkHttpResponse().firstMatchingHeader("Content-Range")).isEmpty();
} finally {
try {
s3.deleteObject(DeleteObjectRequest.builder().bucket(bucket).key(key).build());