Which solution will meet these requirements with the LEAST effort?
Set up a mock integration for API methods in API Gateway. In the integration request from Method Execution, add simple logic to return either a success or error based on HTTP status code. In the integration response, add messages that correspond to the HTTP status codes.
Create two mock integration resources for API methods in API Gateway. In the integration request, return a success HTTP status code for one resource and an error HTTP status code for the other resource. In the integration response, add messages that correspond to the HTTP status codes.
Create Lambda functions to perform tests. Add simple logic to return either success or error, based on the HTTP status codes. Build an API Gateway Lambda integration. Select appropriate Lambda functions that correspond to the HTTP status codes.
Create a Lambda function to perform tests. Add simple logic to return either success or error-based HTTP status codes. Create a mock integration in API Gateway. Select the Lambda function that corresponds to the HTTP status codes.
Explanations:
This option uses API Gateway’s mock integration to simulate responses with success and error HTTP status codes, meeting the testing requirements without extra resources like Lambda functions, minimizing development effort.
While this option uses mock integrations, creating two separate resources for success and error codes requires more setup, making it more complex than needed. It does not minimize effort as effectively as Option A.
This option involves creating multiple Lambda functions for tests, which increases complexity and effort since Lambda is not needed for simple HTTP status code testing in API Gateway when mock integrations can handle it.
Although this option combines Lambda and mock integration, the use of a Lambda function for status code testing is unnecessary and adds complexity. Mock integrations alone can handle the task more efficiently, making Option A the more streamlined solution.