Skip to content

Commit

Permalink
misc: add integration test for empty S3 object (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianbotsf authored Aug 14, 2023
1 parent 17733a9 commit aaf5001
Showing 1 changed file with 19 additions and 0 deletions.
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

0 comments on commit aaf5001

Please sign in to comment.