diff --git a/services/s3/e2eTest/src/PaginatorTest.kt b/services/s3/e2eTest/src/PaginatorTest.kt index 516d4d6ed2b..8eeecb8cd43 100644 --- a/services/s3/e2eTest/src/PaginatorTest.kt +++ b/services/s3/e2eTest/src/PaginatorTest.kt @@ -16,12 +16,14 @@ import kotlinx.coroutines.flow.toList import kotlinx.coroutines.flow.transform import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withTimeout -import kotlin.test.AfterTest -import kotlin.test.BeforeTest -import kotlin.test.Test +import org.junit.jupiter.api.AfterAll +import org.junit.jupiter.api.BeforeAll +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.TestInstance import kotlin.test.assertContentEquals import kotlin.time.Duration.Companion.seconds +@TestInstance(TestInstance.Lifecycle.PER_CLASS) class PaginatorTest { private val client = S3Client { region = S3TestUtils.DEFAULT_REGION @@ -29,12 +31,12 @@ class PaginatorTest { private lateinit var testBucket: String - @BeforeTest + @BeforeAll fun createResources(): Unit = runBlocking { testBucket = S3TestUtils.getTestBucket(client) } - @AfterTest + @AfterAll fun cleanup() = runBlocking { S3TestUtils.deleteBucketAndAllContents(client, testBucket) } diff --git a/services/s3/e2eTest/src/S3IntegrationTest.kt b/services/s3/e2eTest/src/S3IntegrationTest.kt index 7da3f056edf..6b15ddceb8f 100644 --- a/services/s3/e2eTest/src/S3IntegrationTest.kt +++ b/services/s3/e2eTest/src/S3IntegrationTest.kt @@ -22,10 +22,11 @@ import aws.smithy.kotlin.runtime.testing.RandomTempFile import aws.smithy.kotlin.runtime.util.encodeToHex import kotlinx.coroutines.* import kotlinx.coroutines.flow.toList +import org.junit.jupiter.api.AfterAll +import org.junit.jupiter.api.BeforeAll +import org.junit.jupiter.api.TestInstance import java.io.File import java.util.UUID -import kotlin.test.AfterClass -import kotlin.test.BeforeClass import kotlin.test.Test import kotlin.test.assertContains import kotlin.test.assertEquals @@ -37,24 +38,22 @@ import kotlin.time.Duration.Companion.seconds /** * Tests for bucket operations and presigner */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) class S3BucketOpsIntegrationTest { - companion object { - lateinit var testBucket: String + private val client = S3Client { + region = S3TestUtils.DEFAULT_REGION + } - @BeforeClass - @JvmStatic - fun createResources(): Unit = runBlocking { - testBucket = S3TestUtils.getTestBucket(client) - } + private lateinit var testBucket: String - @AfterClass - fun cleanup() = runBlocking { - S3TestUtils.deleteBucketAndAllContents(client, testBucket) - } + @BeforeAll + fun createResources(): Unit = runBlocking { + testBucket = S3TestUtils.getTestBucket(client) } - private val client = S3Client { - region = S3TestUtils.DEFAULT_REGION + @AfterAll + fun cleanup() = runBlocking { + S3TestUtils.deleteBucketAndAllContents(client, testBucket) } @Test diff --git a/services/s3/e2eTest/src/S3PresignerTest.kt b/services/s3/e2eTest/src/S3PresignerTest.kt index b40e387d57e..8cde9c6151e 100644 --- a/services/s3/e2eTest/src/S3PresignerTest.kt +++ b/services/s3/e2eTest/src/S3PresignerTest.kt @@ -16,31 +16,30 @@ import aws.smithy.kotlin.runtime.http.SdkHttpClient import aws.smithy.kotlin.runtime.http.complete import aws.smithy.kotlin.runtime.http.toByteStream import kotlinx.coroutines.* -import kotlin.test.AfterClass -import kotlin.test.BeforeClass +import org.junit.jupiter.api.AfterAll +import org.junit.jupiter.api.BeforeAll +import org.junit.jupiter.api.TestInstance import kotlin.test.Test import kotlin.test.assertEquals import kotlin.time.Duration.Companion.seconds +@TestInstance(TestInstance.Lifecycle.PER_CLASS) class S3PresignerTest { private val client = S3Client { region = S3TestUtils.DEFAULT_REGION } - companion object { - lateinit var testBucket: String + private lateinit var testBucket: String - @BeforeClass - @JvmStatic - fun createResources(): Unit = runBlocking { - testBucket = S3TestUtils.getTestBucket(client) - } + @BeforeAll + fun createResources(): Unit = runBlocking { + testBucket = S3TestUtils.getTestBucket(client) + } - @AfterClass - fun cleanup() = runBlocking { - S3TestUtils.deleteBucketAndAllContents(client, testBucket) - client.close() - } + @AfterAll + fun cleanup(): Unit = runBlocking { + S3TestUtils.deleteBucketAndAllContents(client, testBucket) + client.close() } @Test