-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(appsync): appsync Event API integration assertion tests (#33572)
### Reason for this change Improved assertion tests for newly added AppSync Event API + Channel namespace constructs. Improved documentation to show no channel namespace is created by default, one must be explicitly defined. ### Description of changes * Added assertions to the following integration tests: * `integ.appsync-event-api.ts` * `integ.appsync-eventapi-api-key-auth.ts` * `integ.appsync-eventapi-cognito-auth.ts` * `integ.appsync-eventapi-grants.ts` * `integ.appsync-eventapi-iam-auth.ts` * `integ.appsync-eventapi-lambda-auth.ts` To validate Cognito authorization, I needed to include the following package `@aws-sdk/client-cognito-identity-provider` which is why `yarn.lock` is updated in this PR. - Added channel namespace usage to all Event API examples in `README.md`. ### Describe any new or updated permissions being added N/A ### Description of how you validated changes Integration tests all run successfully with passed assertion tests. ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
61 changed files
with
335,281 additions
and
12,296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
...ramework-integ/test/aws-appsync/test/integ-assets/appsync-js-channel-namespace-handler.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
function enrichEvent(event) { | ||
return { | ||
id: event.id, | ||
payload: { | ||
...event.payload, | ||
newField: 'newField' | ||
} | ||
} | ||
} | ||
export function onPublish(ctx) { | ||
return ctx.events.filter((event) => event.payload.odds > 0) | ||
return ctx.events.map(enrichEvent); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 18 additions & 5 deletions
23
.../aws-appsync/test/integ.appsync-event-api.js.snapshot/appsync-event-api-stack.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.