QuestionQ108

VerifiedSalesforce Integration Testing

Northern Trail Outfitters (NTO) wants to improve the quality of Salesforce callouts to its REST APIs. To do so, NTO will require every API client/consumer to follow REST API Markup Language (RAML) specifications that provide field-level definitions for each API request and response payload. The RAML specifications act as interface contracts on which Apex REST API Clients can rely.

Which two design specifications should the integration architect incorporate into the integration architecture so that Apex REST API Client unit tests verify adherence to the RAML specifications?

Choose two
Explanation

An HttpCalloutMock supplies the simulated HTTP response during an Apex test, so its response status, headers, and payload should conform to the RAML-defined API contract. The test must invoke the Apex REST API client in test context; Salesforce intercepts its HTTP callout and returns the registered mock response, which lets the test verify the client’s contract-compliant processing. The production client does not call or implement the mock interface.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!