-
Notifications
You must be signed in to change notification settings - Fork 173
Open
Labels
confirmedThe scope is clear, ready for implementationThe scope is clear, ready for implementationevent-handlerThis item relates to the Event Handler UtilityThis item relates to the Event Handler UtilityinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)testsPRs that add or change testsPRs that add or change tests
Description
Summary
We should add end to end tests against a real API Gateway endpoint to test the REST API Event Handler.
Why is this needed?
The REST API Handler handler has several interacting components, especially between API Gateway and the lambda function; unit tests alone are not enough to give us confidence that everything is functioning as expected.
Which area does this relate to?
Event Handler
Solution
At a very high level, this would involve creating an API Gateway backed by a lambda function and then invoking the API by making an HTTP request to a test endpoint once it is deployed and ensuring we receive the expected response.
We should have negative and positive tests:
- Test the happy path where a 200 request is returned
- Test the 404 case when a route is not present
- Test the 405 case when a HTTP method is disallowed
- Test the custom error case, where we return a specific expected error type for a particular scenario, e.g., a 400 error for an input validation failure
Acknowledgment
- This request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with π and your use case to help us understand customer demand.
dreamorosi
Metadata
Metadata
Assignees
Labels
confirmedThe scope is clear, ready for implementationThe scope is clear, ready for implementationevent-handlerThis item relates to the Event Handler UtilityThis item relates to the Event Handler UtilityinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)testsPRs that add or change testsPRs that add or change tests
Type
Projects
Status
Backlog