From b7962241acb8c8519cad974f40248ea4f09d157c Mon Sep 17 00:00:00 2001 From: kaizen3031593 Date: Fri, 18 Mar 2022 13:36:24 -0400 Subject: [PATCH 1/2] fix test --- .../aws-events-targets/test/aws-api/aws-api.test.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts b/packages/@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts index cc6c58c51a43d..47ab9975ff635 100644 --- a/packages/@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts @@ -1,4 +1,4 @@ -import { Template } from '@aws-cdk/assertions'; +import { Annotations, Template } from '@aws-cdk/assertions'; import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; import { App, Stack } from '@aws-cdk/core'; @@ -163,9 +163,5 @@ test('with service not in AWS SDK', () => { rule.addTarget(awsApi); // THEN - const assembly = App.of(stack)!.synth().getStackArtifact(stack.stackName); - expect(assembly.messages.length).toBe(1); - const message = assembly.messages[0]; - expect(message.entry.type).toBe('aws:cdk:warning'); - expect(message.entry.data).toBe('Service no-such-service does not exist in the AWS SDK. Check the list of available services and actions from https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html'); + Annotations.fromStack(stack).hasWarning('*', 'Service no-such-service does not exist in the AWS SDK. Check the list of available services and actions from https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html'); }); From c1bf7dbe11b22cb16752a725c8a16f5eff9db3e3 Mon Sep 17 00:00:00 2001 From: Kaizen Conroy <36202692+kaizen3031593@users.noreply.github.com> Date: Mon, 21 Mar 2022 09:49:51 -0400 Subject: [PATCH 2/2] Update aws-api.test.ts --- .../@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts b/packages/@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts index 47ab9975ff635..e8ace62395856 100644 --- a/packages/@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/aws-api/aws-api.test.ts @@ -1,7 +1,7 @@ import { Annotations, Template } from '@aws-cdk/assertions'; import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; -import { App, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; import * as targets from '../../lib'; test('use AwsApi as an event rule target', () => {