Testing and Deployment

An API Gateway REST API mock must return HTTP 200 or 503 based on a request field. Its integration request template already produces the corresponding statusCode value, but both cases return HTTP 200; what should the developer configure?

Show the answer

Correct answerB. Integration response selection patterns and mappings to matching method responses

AWhy not this: Stages represent deployments and do not select response statuses from a request field.

BWhy this is right: Selection patterns distinguish the generated statuses, and response mappings expose the matching HTTP statuses.

CWhy not this: Request models validate request structure; they do not select the mock's HTTP response status.

DWhy not this: Method responses declare possible outputs but do not route the generated status to the appropriate output.

MOCK integrations use the generated statusCode to select an integration response, which maps to a method response status. Declaring method responses alone does not select or map the mock's response.