I want to write a unit test that checks that callout hasn't been made from the trigger.
I know how to test if the callout is made correctly - by implementing HttpCalloutMock:
global class MyHttpCalloutMock implements HttpCalloutMock {
global HTTPResponse respond(HTTPRequest req) {
//test HTTPRequest here
}
}
But if no HTTP request is made, then the respond() method won't be called. So this approach doesn't test if the request was made at all.
I need something like this:
HTTPRequest.assertNoRequestsHaveBeenMade();
How do I do that?