@@ -9,18 +9,14 @@ import aws.sdk.kotlin.runtime.auth.credentials.internal.credentials
99import aws.sdk.kotlin.runtime.client.AwsClientOption
1010import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
1111import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.withBusinessMetric
12- import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.withBusinessMetrics
1312import aws.sdk.kotlin.runtime.util.testAttributes
1413import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
1514import aws.smithy.kotlin.runtime.auth.awscredentials.copy
1615import aws.smithy.kotlin.runtime.collections.attributesOf
1716import aws.smithy.kotlin.runtime.httptest.TestConnection
1817import aws.smithy.kotlin.runtime.httptest.buildTestConnection
1918import aws.smithy.kotlin.runtime.net.Host
20- import aws.smithy.kotlin.runtime.time.Instant
2119import aws.smithy.kotlin.runtime.util.TestPlatformProvider
22- import io.mockk.coEvery
23- import io.mockk.mockkStatic
2420import kotlinx.coroutines.test.runTest
2521import kotlin.test.Test
2622import kotlin.test.assertEquals
@@ -377,57 +373,4 @@ class ProfileCredentialsProviderTest {
377373 )
378374 assertEquals(expected, actual)
379375 }
380-
381- @Test
382- fun processBusinessMetrics () = runTest {
383- val testProvider = TestPlatformProvider (
384- env = mapOf (
385- " AWS_CONFIG_FILE" to " config" ,
386- ),
387- fs = mapOf (
388- " config" to """
389- [default]
390- credential_process = awscreds-custom
391- """ .trimIndent(),
392- " awscreds-custom" to " some-process" ,
393- ),
394- )
395- val testEngine = TestConnection ()
396- val provider = ProfileCredentialsProvider (
397- platformProvider = testProvider,
398- httpClient = testEngine,
399- )
400-
401- mockkStatic(::executeCommand)
402- coEvery { executeCommand(any(), any(), any(), any(), any()) }.returns(
403- Pair (
404- 0 ,
405- """
406- {
407- "Version": 1,
408- "AccessKeyId": "AKID-Default",
409- "SecretAccessKey": "Default-Secret",
410- "SessionToken": "SessionToken",
411- "Expiration" : "2019-05-29T00:21:43Z"
412- }
413- """ .trimIndent(),
414- ),
415- )
416-
417- val actual = provider.resolve()
418- val expected = credentials(
419- " AKID-Default" ,
420- " Default-Secret" ,
421- " SessionToken" ,
422- Instant .fromIso8601(" 2019-05-29T00:21:43Z" ),
423- " Process" ,
424- ).withBusinessMetrics(
425- setOf (
426- AwsBusinessMetric .Credentials .CREDENTIALS_PROFILE_PROCESS ,
427- AwsBusinessMetric .Credentials .CREDENTIALS_PROCESS ,
428- ),
429- )
430-
431- assertEquals(expected, actual)
432- }
433376}
0 commit comments