File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,25 @@ class S3BucketOpsIntegrationTest {
110110 assertEquals(contents, roundTrippedContents)
111111 }
112112
113+ @Test
114+ fun testGetEmptyObject (): Unit = runBlocking {
115+ // See https://github.com/awslabs/aws-sdk-kotlin/issues/1014
116+ val keyName = " get-empty-obj.txt"
117+
118+ client.putObject {
119+ bucket = testBucket
120+ key = keyName
121+ body = ByteStream .fromBytes(byteArrayOf())
122+ }
123+
124+ val req = GetObjectRequest {
125+ bucket = testBucket
126+ key = keyName
127+ }
128+ val actualLength = client.getObject(req) { it.contentLength }
129+ assertEquals(0 , actualLength)
130+ }
131+
113132 @Test
114133 fun testQueryParameterEncoding (): Unit = runBlocking {
115134 // see: https://github.com/awslabs/aws-sdk-kotlin/issues/448
You can’t perform that action at this time.
0 commit comments