Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Maintenance: Add e2e Tests for Event Handler REST APIΒ #4502

@svozza

Description

@svozza

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

Future readers

Please react with πŸ‘ and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedThe scope is clear, ready for implementationevent-handlerThis item relates to the Event Handler UtilityinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)testsPRs that add or change tests

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions