-
Couldn't load subscription status.
- Fork 176
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status