A developer wrote Apex code that calls out to an external system using REST API.
How should a developer write the test to prove the code is working as intended?
A developer wrote Apex code that calls out to an external system using REST API.
How should a developer write the test to prove the code is working as intended?
To write a test for Apex code that calls out to an external system using REST API, the developer should use the HTTPCalloutMock interface. This interface can be implemented to create a mock response for the HTTP request, allowing the developer to test the callout without actually making a real HTTP request. Extending HTTPCalloutMock is incorrect because HTTPCalloutMock is an interface, not a class.
Correct Answer is B. HTTPCalloutMock is an interface. https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_httpcalloutmock.htm