From 20ff8dc248ca86c83f52c32a063e78db5e3c2069 Mon Sep 17 00:00:00 2001 From: Piotr Srebniak Date: Thu, 14 Dec 2023 21:30:47 +0100 Subject: [PATCH] feat: #60 merge remote main and fix unit tests (#68) Fixes #60, merged remote main and fix tests --- test/salesforce/destination.test.ts | 6 +++--- test/salesforce/profile.test.ts | 14 +++++++------- test/salesforce/source.test.ts | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/salesforce/destination.test.ts b/test/salesforce/destination.test.ts index f21c46a0..a4695835 100644 --- a/test/salesforce/destination.test.ts +++ b/test/salesforce/destination.test.ts @@ -2,7 +2,7 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ -import { Stack } from 'aws-cdk-lib'; +import { SecretValue, Stack } from 'aws-cdk-lib'; import { Template } from 'aws-cdk-lib/assertions'; import { Bucket } from 'aws-cdk-lib/aws-s3'; @@ -117,10 +117,10 @@ describe('SalesforceDestination', () => { const secret = Secret.fromSecretNameV2(stack, 'TestSecret', 'appflow/salesforce/client'); const profile = new SalesforceConnectorProfile(stack, 'TestProfile', { oAuth: { - accessToken: 'accessToken', + accessToken: SecretValue.unsafePlainText('accessToken'), flow: { refreshTokenGrant: { - refreshToken: 'refreshToken', + refreshToken: SecretValue.unsafePlainText('refreshToken'), client: secret, }, }, diff --git a/test/salesforce/profile.test.ts b/test/salesforce/profile.test.ts index 31c2518d..d4c47be9 100644 --- a/test/salesforce/profile.test.ts +++ b/test/salesforce/profile.test.ts @@ -2,7 +2,7 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ -import { Stack } from 'aws-cdk-lib'; +import { SecretValue, Stack } from 'aws-cdk-lib'; import { Template } from 'aws-cdk-lib/assertions'; import { Key } from 'aws-cdk-lib/aws-kms'; import { Secret } from 'aws-cdk-lib/aws-secretsmanager'; @@ -18,10 +18,10 @@ describe('SalesforceConnectorProfileProps', () => { new SalesforceConnectorProfile(stack, 'TestProfile', { oAuth: { - accessToken: 'accessToken', + accessToken: SecretValue.unsafePlainText('accessToken'), flow: { refreshTokenGrant: { - refreshToken: 'refreshToken', + refreshToken: SecretValue.unsafePlainText('refreshToken'), client: clientSecret, }, }, @@ -58,10 +58,10 @@ describe('SalesforceConnectorProfileProps', () => { new SalesforceConnectorProfile(stack, 'TestProfile', { oAuth: { - accessToken: secret.secretValueFromJson('accessToken').toString(), + accessToken: secret.secretValueFromJson('accessToken'), flow: { refreshTokenGrant: { - refreshToken: secret.secretValueFromJson('refreshToken').toString(), + refreshToken: secret.secretValueFromJson('refreshToken'), client: secret, }, }, @@ -135,10 +135,10 @@ describe('SalesforceConnectorProfileProps', () => { new SalesforceConnectorProfile(stack, 'TestProfile', { key: key, oAuth: { - accessToken: secret.secretValueFromJson('accessToken').toString(), + accessToken: secret.secretValueFromJson('accessToken'), flow: { refreshTokenGrant: { - refreshToken: secret.secretValueFromJson('refreshToken').toString(), + refreshToken: secret.secretValueFromJson('refreshToken'), client: secret, }, }, diff --git a/test/salesforce/source.test.ts b/test/salesforce/source.test.ts index c9a7a7eb..b5fdf815 100644 --- a/test/salesforce/source.test.ts +++ b/test/salesforce/source.test.ts @@ -2,7 +2,7 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ -import { Stack } from 'aws-cdk-lib'; +import { SecretValue, Stack } from 'aws-cdk-lib'; import { Template } from 'aws-cdk-lib/assertions'; import { Bucket } from 'aws-cdk-lib/aws-s3'; @@ -112,10 +112,10 @@ describe('SalesforceSource', () => { const secret = Secret.fromSecretNameV2(stack, 'TestSecret', 'appflow/salesforce/client'); const profile = new SalesforceConnectorProfile(stack, 'TestProfile', { oAuth: { - accessToken: 'accessToken', + accessToken: SecretValue.unsafePlainText('accessToken'), flow: { refreshTokenGrant: { - refreshToken: 'refreshToken', + refreshToken: SecretValue.unsafePlainText('refreshToken'), client: secret, }, },