Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: add integration test for empty S3 object #1015

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions services/s3/e2eTest/src/S3IntegrationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ class S3BucketOpsIntegrationTest {
assertEquals(contents, roundTrippedContents)
}

@Test
fun testGetEmptyObject(): Unit = runBlocking {
// See https://github.com/awslabs/aws-sdk-kotlin/issues/1014
val keyName = "get-empty-obj.txt"

client.putObject {
bucket = testBucket
key = keyName
body = ByteStream.fromBytes(byteArrayOf())
}

val req = GetObjectRequest {
bucket = testBucket
key = keyName
}
val actualLength = client.getObject(req) { it.contentLength }
assertEquals(0, actualLength)
}

@Test
fun testQueryParameterEncoding(): Unit = runBlocking {
// see: https://github.com/awslabs/aws-sdk-kotlin/issues/448
Expand Down
Loading