File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1599,6 +1599,29 @@ internal class GetPutDeleteObjectIT : S3TestBase() {
15991599 }
16001600 }
16011601
1602+ @Test
1603+ @S3VerifiedSuccess(year = 2025 )
1604+ fun testGetObject_rangeDownloads_fail_emptyObject (testInfo : TestInfo ) {
1605+ val bucketName = givenBucket(testInfo)
1606+ s3Client.putObject(
1607+ {
1608+ it.bucket(bucketName)
1609+ it.key(UPLOAD_FILE_NAME )
1610+ },
1611+ RequestBody .fromBytes(ByteArray (0 )),
1612+ )
1613+ val smallRequestEndBytes = 2L
1614+
1615+ assertThatThrownBy {
1616+ s3Client.getObject {
1617+ it.bucket(bucketName)
1618+ it.key(UPLOAD_FILE_NAME )
1619+ it.range(" bytes=-$smallRequestEndBytes " )
1620+ }
1621+ }.isInstanceOf(S3Exception ::class .java)
1622+ .hasMessageContaining(" Service: S3, Status Code: 416" )
1623+ }
1624+
16021625 @Test
16031626 @S3VerifiedSuccess(year = 2025 )
16041627 fun testGetObject_rangeDownloads_finalBytes_prefixOffset (testInfo : TestInfo ) {
You can’t perform that action at this time.
0 commit comments