AWS Certified Developer – Associate (DVA-C02) — Question 324
A developer is working on an ecommerce platform that communicates with several third-party payment processing APIs. The third-party payment services do not provide a test environment.
The developer needs to validate the ecommerce platform's integration with the third-party payment processing APIs. The developer must test the API integration code without invoking the third-party payment processing APIs.
Which solution will meet these requirements?
Answer options
- A. Set up an Amazon API Gateway REST API with a gateway response configured for status code 200. Add response templates that contain sample responses captured from the real third-party API.
- B. Set up an AWS AppSync GraphQL API with a data source configured for each third-party API. Specify an integration type of Mock. Configure integration responses by using sample responses captured from the real third-party API.
- C. Create an AWS Lambda function for each third-party API. Embed responses captured from the real third-party API. Configure Amazon Route 53 Resolver with an inbound endpoint for each Lambda function's Amazon Resource Name (ARN).
- D. Set up an Amazon API Gateway REST API for each third-party API. Specify an integration request type of Mock. Configure integration responses by using sample responses captured from the real third-party API.
Correct answer: D
Explanation
Amazon API Gateway supports a Mock integration type, which allows developers to return API responses directly from API Gateway without forwarding the request to a backend integration. This enables the simulation of third-party payment APIs using pre-captured sample responses without incurring additional backend execution costs or complexity. Other approaches like using Route 53 Resolvers with Lambda or AppSync mock data sources introduce unnecessary complexity and do not align with standard REST API mocking practices.