Skip to content

Commit

Permalink
fix(sns-publish-test-v3): fix sns version
Browse files Browse the repository at this point in the history
  • Loading branch information
haddasbronfman committed May 9, 2022
1 parent c59be7a commit 56e1cd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions plugins/node/opentelemetry-instrumentation-aws-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
"@opentelemetry/propagation-utils": "^0.27.0"
},
"devDependencies": {
"@aws-sdk/client-dynamodb": "3.37.0",
"@aws-sdk/client-lambda": "3.37.0",
"@aws-sdk/client-s3": "3.37.0",
"@aws-sdk/client-sqs": "3.37.0",
"@aws-sdk/client-sns": "3.54.1",
"@aws-sdk/types": "3.37.0",
"@aws-sdk/client-dynamodb": "3.85.0",
"@aws-sdk/client-lambda": "3.85.0",
"@aws-sdk/client-s3": "3.85.0",
"@aws-sdk/client-sqs": "3.85.0",
"@aws-sdk/client-sns": "3.85.0",
"@aws-sdk/types": "3.78.0",
"@opentelemetry/api": "1.0.1",
"@opentelemetry/contrib-test-utils": "0.29.0",
"@opentelemetry/sdk-trace-base": "1.2.0",
Expand Down
20 changes: 10 additions & 10 deletions plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {
const instrumentation = registerInstrumentationTesting(
new AwsInstrumentation()
);
import * as AWS from 'aws-sdk';
import { SNS } from '@aws-sdk/client-sns';
import * as AWSv2 from 'aws-sdk';
import { SNS as SNSv3 } from '@aws-sdk/client-sns';
import * as fs from 'fs';
import * as nock from 'nock';

Expand All @@ -46,7 +46,7 @@ const fakeARN = `arn:aws:sns:region:000000000:${topicName}`;

describe('SNS - v2', () => {
before(() => {
AWS.config.credentials = {
AWSv2.config.credentials = {
accessKeyId: 'test key id',
expired: false,
expireTime: new Date(),
Expand All @@ -61,9 +61,9 @@ describe('SNS - v2', () => {
} as AWS.SNS.Types.PublishResponse);
});

describe('publish - v2', () => {
describe('publish', () => {
it('topic arn', async () => {
const sns = new AWS.SNS();
const sns = new AWSv2.SNS();

await sns
.publish({
Expand Down Expand Up @@ -94,7 +94,7 @@ describe('SNS - v2', () => {
});

it('phone number', async () => {
const sns = new AWS.SNS();
const sns = new AWSv2.SNS();
const PhoneNumber = 'my phone number';
await sns
.publish({
Expand All @@ -114,7 +114,7 @@ describe('SNS - v2', () => {
});

it('inject context propagation', async () => {
const sns = new AWS.SNS();
const sns = new AWSv2.SNS();
const hookSpy = sinon.spy(
(instrumentation['servicesExtensions'] as any)['services'].get('SNS'),
'requestPostSpanHook'
Expand All @@ -139,7 +139,7 @@ describe('SNS - v2', () => {

describe('createTopic', () => {
it('basic createTopic creates a valid span', async () => {
const sns = new AWS.SNS();
const sns = new AWSv2.SNS();

const Name = 'my new topic';
await sns.createTopic({ Name }).promise();
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('SNS - v2', () => {
describe('SNS - v3', () => {
let sns: any;
beforeEach(() => {
sns = new SNS({
sns = new SNSv3({
region: 'us-east-1',
credentials: {
accessKeyId: 'abcde',
Expand All @@ -183,7 +183,7 @@ describe('SNS - v3', () => {
);
});

describe('publish - v3', () => {
describe('publish', () => {
it('topic arn', async () => {
const topicV3Name = 'dummy-sns-v3-topic';
await sns.publish({
Expand Down

0 comments on commit 56e1cd7

Please sign in to comment.