Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused experimental annotations #961

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions docs/design/binary-streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ suspend fun ByteStream.toByteArray(): ByteArray {...}
/**
* Consume a [ByteStream] and decode the contests as a string
*/
@OptIn(ExperimentalStdlibApi::class)
suspend fun ByteStream.decodeToString(): String = toByteArray().decodeToString()


Expand Down Expand Up @@ -588,8 +587,6 @@ fun fromByteArray(array: ByteArray): Flow<ByteArray> = flowOf(array)
fun fromString(string: String): Flow<ByteArray> = fromByteArray(string.toByteArray())
fun fromFile(file: File): Flow<ByteArray> = TODO()


@OptIn(ExperimentalStdlibApi::class)
suspend fun Flow<ByteArray>.decodeToString(): String = toByteArray().decodeToString()

// NOTE: this is just an example, there are potentially more efficient ways to do this
Expand Down
1 change: 0 additions & 1 deletion docs/design/waiters.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class Waiter<I, O>(
val acceptors: List<Acceptor<I, O>>,
val delayProvider: DelayProvider,
) {
@OptIn(ExperimentalTime::class)
suspend fun retry(input: I): WaiterOutcome<O> =
withTimeout(options.maxDuration.inWholeMilliseconds) {
doTryLoop(input, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.ManualClock
import aws.smithy.kotlin.runtime.util.Attributes
import io.kotest.matchers.string.shouldContain
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds

@OptIn(ExperimentalCoroutinesApi::class)
class CachedCredentialsProviderTest {
private val epoch = Instant.fromIso8601("2020-10-16T03:56:00Z")
private val testExpiration = epoch + 30.minutes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
package aws.smithy.kotlin.runtime.auth.awscredentials

import aws.smithy.kotlin.runtime.util.Attributes
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals

@OptIn(ExperimentalCoroutinesApi::class)
class CredentialsProviderChainTest {
private class TestCredentialsProvider(val accessKeyId: String? = null, val secretAccessKey: String? = null) : CredentialsProvider {
override suspend fun resolve(attributes: Attributes): Credentials =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ import aws.smithy.kotlin.runtime.http.request.url
import aws.smithy.kotlin.runtime.net.Url
import aws.smithy.kotlin.runtime.operation.ExecutionContext
import aws.smithy.kotlin.runtime.util.Attributes
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals

private const val NON_HTTPS_URL = "http://localhost:8080/path/to/resource?foo=bar"

@OptIn(ExperimentalCoroutinesApi::class)
class PresignerTest {
// Verify that custom endpoint URL schemes aren't changed.
// See https://github.com/awslabs/aws-sdk-kotlin/issues/938
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import aws.smithy.kotlin.runtime.net.Host
import aws.smithy.kotlin.runtime.net.UrlBuilder
import aws.smithy.kotlin.runtime.net.parameters
import aws.smithy.kotlin.runtime.time.Instant
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals

@OptIn(ExperimentalCoroutinesApi::class)
class DefaultCanonicalizerTest {
// Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import aws.smithy.kotlin.runtime.hashing.sha256
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.util.decodeHexBytes
import aws.smithy.kotlin.runtime.util.encodeToHex
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
Expand All @@ -33,7 +32,6 @@ class DefaultSignatureCalculatorTest {
}

// Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
@OptIn(ExperimentalCoroutinesApi::class)
@Test
fun testSigningKey() = runTest {
val config = AwsSigningConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package aws.smithy.kotlin.runtime.auth.awssigning.tests
import aws.smithy.kotlin.runtime.auth.awssigning.*
import aws.smithy.kotlin.runtime.auth.awssigning.internal.CHUNK_SIZE_BYTES
import aws.smithy.kotlin.runtime.io.*
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.TestResult
Expand All @@ -17,7 +16,6 @@ import kotlin.random.Random
import kotlin.test.*
import kotlin.time.Duration.Companion.milliseconds

@OptIn(ExperimentalCoroutinesApi::class)
abstract class AwsChunkedByteReadChannelTestBase : AwsChunkedTestBase(AwsChunkedReaderFactory.Channel) {
@Test
fun testSlowProducerMultipleChunksPartialLast(): TestResult = runTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import aws.smithy.kotlin.runtime.http.DeferredHeaders
import aws.smithy.kotlin.runtime.http.toHeaders
import aws.smithy.kotlin.runtime.io.*
import aws.smithy.kotlin.runtime.time.Instant
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestResult
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.withTimeout
Expand Down Expand Up @@ -53,7 +52,6 @@ fun AwsChunkedReaderFactory.create(
previousSignature: ByteArray,
): AwsChunkedTestReader = create(data, signer, signingConfig, previousSignature, DeferredHeaders.Empty)

@OptIn(ExperimentalCoroutinesApi::class)
abstract class AwsChunkedTestBase(
val factory: AwsChunkedReaderFactory,
) : HasSigner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import aws.smithy.kotlin.runtime.net.Host
import aws.smithy.kotlin.runtime.net.Scheme
import aws.smithy.kotlin.runtime.net.Url
import aws.smithy.kotlin.runtime.time.Instant
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestResult
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
Expand Down Expand Up @@ -47,7 +46,6 @@ private const val EXPECTED_FINAL_CHUNK_SIGNATURE = "b6c6ea8a5354eaf15b3cb7646744
private val EMPTY_BYTES = byteArrayOf()

@Suppress("HttpUrlsUsage")
@OptIn(ExperimentalCoroutinesApi::class)
public abstract class BasicSigningTestBase : HasSigner {
private val defaultSigningConfig = AwsSigningConfig {
region = "us-east-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import aws.smithy.kotlin.runtime.operation.ExecutionContext
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.util.Attributes
import aws.smithy.kotlin.runtime.util.get
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestResult
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
Expand All @@ -40,7 +39,6 @@ class CrtAwsHttpSignerTest : AwsHttpSignerTestBase(CrtAwsSigner)
* test suite in the `aws-signing-tests` module.
*/
@Suppress("HttpUrlsUsage")
@OptIn(ExperimentalCoroutinesApi::class)
public abstract class AwsHttpSignerTestBase(
private val signer: AwsSigner,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ package aws.smithy.kotlin.runtime.http.auth
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.util.Attributes
import aws.smithy.kotlin.runtime.util.emptyAttributes
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test

@OptIn(ExperimentalCoroutinesApi::class)
class BearerTokenProviderChainTest {
private class TestTokenProvider(val token: String? = null) : BearerTokenProvider {
override suspend fun resolve(attributes: Attributes): BearerToken =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.util.Attributes
import aws.smithy.kotlin.runtime.util.emptyAttributes
import io.kotest.matchers.string.shouldContain
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

@OptIn(ExperimentalCoroutinesApi::class)
class BearerTokenSignerTest {
@Test
fun testAuthorizationHeader() = runTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.util.Attributes
import aws.smithy.kotlin.runtime.util.emptyAttributes
import io.kotest.matchers.string.shouldContain
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFails
import kotlin.test.assertFailsWith

@OptIn(ExperimentalCoroutinesApi::class)
class IdentityProviderChainTest {

private class TestChain(vararg providers: IdentityProvider) : IdentityProviderChain<IdentityProvider, Identity>(*providers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import aws.smithy.kotlin.runtime.io.SdkBuffer
import aws.smithy.kotlin.runtime.io.SdkByteChannel
import aws.smithy.kotlin.runtime.io.SdkByteReadChannel
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.runTest
Expand All @@ -21,7 +20,6 @@ import kotlin.test.assertFailsWith
import kotlin.test.assertFalse
import kotlin.test.assertTrue

@OptIn(ExperimentalCoroutinesApi::class)
class ReadChannelBodyStreamTest {
private fun mutableBuffer(capacity: Int): Pair<MutableBuffer, ByteArray> {
val dest = ByteArray(capacity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ import aws.sdk.kotlin.crt.io.MutableBuffer
import aws.smithy.kotlin.runtime.io.SdkBuffer
import aws.smithy.kotlin.runtime.io.SdkSource
import aws.smithy.kotlin.runtime.io.source
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue

@OptIn(ExperimentalCoroutinesApi::class)
class SdkSourceBodyStreamTest {
private fun mutableBuffer(capacity: Int): Pair<MutableBuffer, ByteArray> {
val dest = ByteArray(capacity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@

package aws.smithy.kotlin.runtime.telemetry.logging

import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals

@OptIn(ExperimentalCoroutinesApi::class)
class TestLoggingContext {
@Test
fun testWithLogCtx() = runTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ import aws.smithy.kotlin.runtime.time.ManualClock
import aws.smithy.kotlin.runtime.util.Attributes
import aws.smithy.kotlin.runtime.util.encodeToHex
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.toList
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals

@OptIn(ExperimentalCoroutinesApi::class)
class EventStreamSigningTest {
private val testCredentials = Credentials("fake access key", "fake secret key")
private val testCredentialsProvider = object : CredentialsProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ package aws.smithy.kotlin.runtime.awsprotocol.eventstream

import aws.smithy.kotlin.runtime.io.*
import io.kotest.matchers.string.shouldContain
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

@OptIn(ExperimentalCoroutinesApi::class)
class FrameDecoderTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package aws.smithy.kotlin.runtime.awsprotocol.eventstream

import aws.smithy.kotlin.runtime.http.readAll
import aws.smithy.kotlin.runtime.io.SdkBuffer
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.toList
Expand All @@ -16,7 +15,6 @@ import kotlin.test.Test
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals

@OptIn(ExperimentalCoroutinesApi::class)
class FrameEncoderTest {
@Test
fun testEncode() = runTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ import aws.smithy.kotlin.runtime.http.response.HttpResponse
import aws.smithy.kotlin.runtime.httptest.TestEngine
import aws.smithy.kotlin.runtime.operation.ExecutionContext
import aws.smithy.kotlin.runtime.util.get
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals

@OptIn(ExperimentalCoroutinesApi::class)
class AwsJsonProtocolTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
package aws.smithy.kotlin.runtime.awsprotocol.json

import aws.smithy.kotlin.runtime.http.Headers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals

@Suppress("HttpUrlsUsage")
class RestJsonErrorDeserializerTest {

@OptIn(ExperimentalStdlibApi::class, ExperimentalCoroutinesApi::class)
@Test
fun `it deserializes aws restJson error codes`() = runTest {
val tests = listOf(
Expand Down Expand Up @@ -64,7 +62,6 @@ class RestJsonErrorDeserializerTest {
}
}

@OptIn(ExperimentalStdlibApi::class, ExperimentalCoroutinesApi::class)
@Test
fun `it deserializes aws restJson error codes using right location check order`() = runTest {
// Checking for header code return
Expand Down Expand Up @@ -112,7 +109,6 @@ class RestJsonErrorDeserializerTest {
assertEquals("BodyCode", RestJsonErrorDeserializer.deserialize(headers, payload).code)
}

@OptIn(ExperimentalStdlibApi::class, ExperimentalCoroutinesApi::class)
@Test
fun `it deserializes aws restJson error messages`() = runTest {
val expected = "one ring to rule bring them all, and in the darkness bind them"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
package aws.smithy.kotlin.runtime.awsprotocol.xml

import aws.smithy.kotlin.runtime.serde.DeserializationException
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertNull

@OptIn(ExperimentalCoroutinesApi::class)
class Ec2QueryErrorDeserializerTest {
@Test
fun `it deserializes ec2Query errors`() = runTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
package aws.smithy.kotlin.runtime.awsprotocol.xml

import aws.smithy.kotlin.runtime.serde.DeserializationException
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import kotlin.test.*

@OptIn(ExperimentalCoroutinesApi::class)
class RestXmlErrorDeserializerTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import kotlin.coroutines.CoroutineContext
* Implements the CRT stream response interface which proxies the response from the CRT to the SDK
* @param conn The HTTP connection used to make the request. Will be closed when the response handler completes
*/
@OptIn(ExperimentalCoroutinesApi::class, DelicateCoroutinesApi::class)
@OptIn(DelicateCoroutinesApi::class)
internal class SdkStreamResponseHandler(
private val conn: HttpClientConnection,
private val callContext: CoroutineContext,
Expand Down Expand Up @@ -80,7 +80,6 @@ internal class SdkStreamResponseHandler(
}
}

@OptIn(DelicateCoroutinesApi::class)
private fun createHttpResponseBody(contentLength: Long?): HttpBody {
val ch = SdkByteChannel(true)
val writerContext = callContext + callContext.derivedName("response-body-writer")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ import aws.smithy.kotlin.runtime.io.SdkSink
import aws.smithy.kotlin.runtime.io.readAll
import aws.smithy.kotlin.runtime.io.readToBuffer
import io.kotest.matchers.string.shouldContain
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.yield
import kotlin.test.*

@OptIn(ExperimentalCoroutinesApi::class)
class SdkStreamResponseHandlerTest {

private class MockHttpStream(override val responseStatusCode: Int) : HttpStream {
Expand Down
Loading
Loading