QuestionQ154

VerifiedSalesforce Integration Testing

Northern Trail Outfitters (NTO) wants to improve the quality of Salesforce callouts to its REST APIs. For this purpose, NTO will require all API clients/consumers to follow REST API Markup Language (RAML) specifications that include the field-level definition of every API request and response payload. The RAML specifications serve as interface contracts that Apex REST API Clients can rely on.

Which design specification should the integration architect include in the integration architecture so that Apex REST API Clients' unit tests verify adherence to the RAML specifications?

Explanation

An HttpCalloutMock implementation supplies the simulated HTTP response used by an Apex callout test. Returning responses that conform to the RAML-defined payload contract lets the client tests validate their parsing and handling of the specified fields. The test registers the mock with Test.setMock; a production Apex REST client does not call the mock directly.

Learn more

Community Discussion

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