From e7a79e198d7bd4af817bcbb77373975d3cdee95b Mon Sep 17 00:00:00 2001 From: Ken Gilmer Date: Fri, 24 Sep 2021 18:51:14 -0700 Subject: [PATCH] Replace junit imports with kotlin.test imports where possible --- .../crt/BufferedReadChannelByteBufferTest.kt | 2 +- .../JvmSystemPropRegionProviderTest.kt | 2 +- .../kotlin/codegen/PresignerGeneratorTest.kt | 2 +- .../codegen/customization/BoxServicesTest.kt | 2 +- .../PresignableModelIntegrationTest.kt | 2 +- .../RemoveEventStreamOperationsTest.kt | 2 +- .../core/EndpointResolverGeneratorTest.kt | 2 +- .../json/AwsJsonHttpBindingResolverTest.kt | 37 ++++++++++--------- .../RestXmlSerdeDescriptorGeneratorTest.kt | 2 +- .../sdk/kotlin/services/polly/PollyTest.kt | 2 +- 10 files changed, 28 insertions(+), 27 deletions(-) diff --git a/aws-runtime/http-client-engine-crt/jvm/test/aws/sdk/kotlin/runtime/http/engine/crt/BufferedReadChannelByteBufferTest.kt b/aws-runtime/http-client-engine-crt/jvm/test/aws/sdk/kotlin/runtime/http/engine/crt/BufferedReadChannelByteBufferTest.kt index 5b1b91bdc4b..b68aad4f870 100644 --- a/aws-runtime/http-client-engine-crt/jvm/test/aws/sdk/kotlin/runtime/http/engine/crt/BufferedReadChannelByteBufferTest.kt +++ b/aws-runtime/http-client-engine-crt/jvm/test/aws/sdk/kotlin/runtime/http/engine/crt/BufferedReadChannelByteBufferTest.kt @@ -9,9 +9,9 @@ import aws.sdk.kotlin.runtime.testing.ManualDispatchTestBase import kotlinx.coroutines.CancellationException import kotlinx.coroutines.launch import kotlinx.coroutines.yield -import org.junit.jupiter.api.Test import java.nio.ByteBuffer import kotlin.test.AfterTest +import kotlin.test.Test import kotlin.test.assertEquals class BufferedReadChannelByteBufferTest : ManualDispatchTestBase() { diff --git a/aws-runtime/regions/jvm/test/aws/sdk/kotlin/runtime/regions/providers/JvmSystemPropRegionProviderTest.kt b/aws-runtime/regions/jvm/test/aws/sdk/kotlin/runtime/regions/providers/JvmSystemPropRegionProviderTest.kt index 57b676b1153..ba214e211ae 100644 --- a/aws-runtime/regions/jvm/test/aws/sdk/kotlin/runtime/regions/providers/JvmSystemPropRegionProviderTest.kt +++ b/aws-runtime/regions/jvm/test/aws/sdk/kotlin/runtime/regions/providers/JvmSystemPropRegionProviderTest.kt @@ -7,7 +7,7 @@ package aws.sdk.kotlin.runtime.regions.providers import aws.sdk.kotlin.runtime.AwsSdkSetting import aws.sdk.kotlin.runtime.testing.runSuspendTest -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNull diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/PresignerGeneratorTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/PresignerGeneratorTest.kt index c52a4039a65..49a39b95129 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/PresignerGeneratorTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/PresignerGeneratorTest.kt @@ -1,7 +1,6 @@ package aws.sdk.kotlin.codegen import aws.sdk.kotlin.codegen.model.traits.Presignable -import org.junit.jupiter.api.Test import software.amazon.smithy.build.MockManifest import software.amazon.smithy.codegen.core.SymbolProvider import software.amazon.smithy.kotlin.codegen.KotlinSettings @@ -14,6 +13,7 @@ import software.amazon.smithy.kotlin.codegen.test.shouldContainOnlyOnceWithDiff import software.amazon.smithy.kotlin.codegen.test.toSmithyModel import software.amazon.smithy.model.Model import software.amazon.smithy.model.shapes.OperationShape +import kotlin.test.Test import kotlin.test.assertTrue class PresignerGeneratorTest { diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/BoxServicesTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/BoxServicesTest.kt index 492a06e1071..a78b14bda11 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/BoxServicesTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/BoxServicesTest.kt @@ -5,7 +5,6 @@ package aws.sdk.kotlin.codegen.customization -import org.junit.jupiter.api.Test import software.amazon.smithy.kotlin.codegen.model.expectShape import software.amazon.smithy.kotlin.codegen.model.hasTrait import software.amazon.smithy.kotlin.codegen.model.isNumberShape @@ -14,6 +13,7 @@ import software.amazon.smithy.kotlin.codegen.test.prependNamespaceAndService import software.amazon.smithy.kotlin.codegen.test.toSmithyModel import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.model.traits.BoxTrait +import kotlin.test.Test import kotlin.test.assertFalse import kotlin.test.assertTrue diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/PresignableModelIntegrationTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/PresignableModelIntegrationTest.kt index 435a36c6260..5d68d410760 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/PresignableModelIntegrationTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/PresignableModelIntegrationTest.kt @@ -1,11 +1,11 @@ package aws.sdk.kotlin.codegen.customization import aws.sdk.kotlin.codegen.model.traits.Presignable -import org.junit.jupiter.api.Test import software.amazon.smithy.kotlin.codegen.model.expectShape import software.amazon.smithy.kotlin.codegen.test.newTestContext import software.amazon.smithy.kotlin.codegen.test.toSmithyModel import software.amazon.smithy.model.shapes.OperationShape +import kotlin.test.Test import kotlin.test.assertFalse import kotlin.test.assertTrue diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/RemoveEventStreamOperationsTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/RemoveEventStreamOperationsTest.kt index 6187b7c7188..0ee9b0c83c8 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/RemoveEventStreamOperationsTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/RemoveEventStreamOperationsTest.kt @@ -6,11 +6,11 @@ package aws.sdk.kotlin.codegen.customization import io.kotest.matchers.shouldBe -import org.junit.jupiter.api.Test import software.amazon.smithy.kotlin.codegen.test.newTestContext import software.amazon.smithy.kotlin.codegen.test.prependNamespaceAndService import software.amazon.smithy.kotlin.codegen.test.toSmithyModel import software.amazon.smithy.model.shapes.ShapeId +import kotlin.test.Test class RemoveEventStreamOperationsTest { @Test diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/core/EndpointResolverGeneratorTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/core/EndpointResolverGeneratorTest.kt index 059399b0c1e..46f40762ec8 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/core/EndpointResolverGeneratorTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/core/EndpointResolverGeneratorTest.kt @@ -6,11 +6,11 @@ package aws.sdk.kotlin.codegen.protocols.core import io.kotest.matchers.string.shouldContainOnlyOnce -import org.junit.jupiter.api.Test import software.amazon.smithy.build.MockManifest import software.amazon.smithy.kotlin.codegen.test.newTestContext import software.amazon.smithy.kotlin.codegen.test.toSmithyModel import software.amazon.smithy.model.node.Node +import kotlin.test.Test class EndpointResolverGeneratorTest { diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/json/AwsJsonHttpBindingResolverTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/json/AwsJsonHttpBindingResolverTest.kt index b02d025d7fa..216e7b92e43 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/json/AwsJsonHttpBindingResolverTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/json/AwsJsonHttpBindingResolverTest.kt @@ -5,14 +5,15 @@ package aws.sdk.kotlin.codegen.protocols.json -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test import software.amazon.smithy.kotlin.codegen.model.expectShape import software.amazon.smithy.kotlin.codegen.test.newTestContext import software.amazon.smithy.kotlin.codegen.test.toSmithyModel import software.amazon.smithy.model.knowledge.HttpBinding import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.StructureShape +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue class AwsJsonHttpBindingResolverTest { private val testModel = """ @@ -54,7 +55,7 @@ class AwsJsonHttpBindingResolverTest { val expectedOperations = listOf("GetEmptyFoo", "GetFoo") val actualOperations = unit.bindingOperations().map { operationShape -> operationShape.id.name }.sorted() - Assertions.assertEquals(expectedOperations, actualOperations) + assertEquals(expectedOperations, actualOperations) } @Test @@ -65,7 +66,7 @@ class AwsJsonHttpBindingResolverTest { val actualRequestBindings = unit.requestBindings(operation) - Assertions.assertTrue(actualRequestBindings.isEmpty()) + assertTrue(actualRequestBindings.isEmpty()) } @Test @@ -76,13 +77,13 @@ class AwsJsonHttpBindingResolverTest { val actualRequestBindings = unit.requestBindings(operation) - Assertions.assertTrue(actualRequestBindings.size == 1) + assertTrue(actualRequestBindings.size == 1) val binding = actualRequestBindings.first() - Assertions.assertEquals(binding.member.id.toString(), "smithy.example#GetFooInput\$bigInt") - Assertions.assertEquals(binding.location, HttpBinding.Location.DOCUMENT) + assertEquals(binding.member.id.toString(), "smithy.example#GetFooInput\$bigInt") + assertEquals(binding.location, HttpBinding.Location.DOCUMENT) // Location name is unused by awsJson - Assertions.assertEquals(binding.locationName, null) + assertEquals(binding.locationName, null) } @Test @@ -93,7 +94,7 @@ class AwsJsonHttpBindingResolverTest { val actualResponseBindings = unit.responseBindings(operation) - Assertions.assertTrue(actualResponseBindings.isEmpty()) + assertTrue(actualResponseBindings.isEmpty()) } @Test @@ -104,13 +105,13 @@ class AwsJsonHttpBindingResolverTest { val actualResponseBindings = unit.responseBindings(operation) - Assertions.assertTrue(actualResponseBindings.size == 1) + assertTrue(actualResponseBindings.size == 1) val binding = actualResponseBindings.first() - Assertions.assertEquals(binding.member.id.toString(), "smithy.example#GetFooOutput\$bigInt") - Assertions.assertEquals(binding.location, HttpBinding.Location.DOCUMENT) + assertEquals(binding.member.id.toString(), "smithy.example#GetFooOutput\$bigInt") + assertEquals(binding.location, HttpBinding.Location.DOCUMENT) // Location name is unused by awsJson - Assertions.assertEquals(binding.locationName, null) + assertEquals(binding.locationName, null) } @Test @@ -121,7 +122,7 @@ class AwsJsonHttpBindingResolverTest { val actualResponseBindings = unit.responseBindings(structure) - Assertions.assertTrue(actualResponseBindings.isEmpty()) + assertTrue(actualResponseBindings.isEmpty()) } @Test @@ -132,12 +133,12 @@ class AwsJsonHttpBindingResolverTest { val actualResponseBindings = unit.responseBindings(structure) - Assertions.assertTrue(actualResponseBindings.size == 1) + assertTrue(actualResponseBindings.size == 1) val binding = actualResponseBindings.first() - Assertions.assertEquals(binding.member.id.toString(), "smithy.example#GetFooOutput\$bigInt") - Assertions.assertEquals(binding.location, HttpBinding.Location.DOCUMENT) + assertEquals(binding.member.id.toString(), "smithy.example#GetFooOutput\$bigInt") + assertEquals(binding.location, HttpBinding.Location.DOCUMENT) // Location name is unused by awsJson - Assertions.assertEquals(binding.locationName, null) + assertEquals(binding.locationName, null) } } diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/xml/RestXmlSerdeDescriptorGeneratorTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/xml/RestXmlSerdeDescriptorGeneratorTest.kt index 8714ef6bdc1..17f22a4abc2 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/xml/RestXmlSerdeDescriptorGeneratorTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/protocols/xml/RestXmlSerdeDescriptorGeneratorTest.kt @@ -5,9 +5,9 @@ package aws.sdk.kotlin.codegen.protocols.xml -import org.junit.jupiter.api.Test import software.amazon.smithy.kotlin.codegen.test.* import software.amazon.smithy.model.shapes.ShapeId +import kotlin.test.Test class RestXmlSerdeDescriptorGeneratorTest { private fun render(modelSnippet: String): String { diff --git a/services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt b/services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt index 31df18bc4aa..595b542e664 100644 --- a/services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt +++ b/services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt @@ -6,7 +6,7 @@ import aws.sdk.kotlin.services.polly.model.OutputFormat import aws.sdk.kotlin.services.polly.model.SynthesizeSpeechRequest import aws.sdk.kotlin.services.polly.model.VoiceId import aws.smithy.kotlin.runtime.http.HttpMethod -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue