DVA-C02 · Question #331
A company is using Amazon API Gateway to develop an API for its application on AWS. A developer needs to test and generate API responses. Other teams are required to test the API immediately. What sho
The correct answer is A. Set up a mock integration request in API Gateway. Configure the method's integration request. API Gateway mock integrations let developers generate synthetic responses without a backend, enabling immediate testing by all teams.
Question
A company is using Amazon API Gateway to develop an API for its application on AWS. A developer needs to test and generate API responses. Other teams are required to test the API immediately. What should the developer do to meet these requirements?
Options
- ASet up a mock integration request in API Gateway. Configure the method's integration request
- BSet up the request validators in the API's OpenAPI definition file. Import the OpenAPI definitions
- CSet up a gateway response for the API in API Gateway. Configure response headers with
- DSet up a request parameter-based Lambda authorizer to control access to the API. Configure the
How the community answered
(41 responses)- A80% (33)
- B7% (3)
- C2% (1)
- D10% (4)
Why each option
API Gateway mock integrations let developers generate synthetic responses without a backend, enabling immediate testing by all teams.
A mock integration in API Gateway allows the developer to define static responses directly in the method's integration request without any backend service. This means all teams can call the endpoint and receive configured responses immediately, making it ideal for early-stage API testing and parallel team development.
Request validators in an OpenAPI definition enforce input validation but do not generate or return mock responses for testing.
Gateway responses customize error responses (4xx/5xx) returned by API Gateway itself, not simulated backend responses for functional testing.
A Lambda authorizer controls access to the API based on a token or request parameter but does not generate test responses.
Concept tested: API Gateway mock integration for testing
Source: https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-mock-integration.html
Community Discussion
No community discussion yet for this question.