Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @isTest
- global class AnimalLocatorMock implements HttpCalloutMock {
- // Implement this interface method
- global HTTPResponse respond(HTTPRequest request) {
- // Create a fake response
- HttpResponse response = new HttpResponse();
- response.setHeader('Content-Type', 'application/json');
- response.setBody('{"animal":{"id":1,"name":"chicken","eats":"chicken food","says":"cluck cluck"}}');
- response.setStatusCode(200);
- return response;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement