We have a problem in our organization and I was hoping for some advice from you on how to best tackle this.
We have a handler class that makes a callout to a Master Data Management system for account validation. That handler class is perfectly covered by it's own tests that utilize Mocking of the outbound call.
Now our business process dictates that we need to do a check every time an Account is created or updated, so we invoke that callout from an Account After trigger.
Now we run into a problem as any testmethod we have in the system that tries to construct an Account for unit testing purposes triggers the outbound callout and fails with a Fatal error: testmethods cannot invoke callouts.
Can somebody give us a hint on how to best properly deal with this?
Best regards, Ivar
future
annotation, implementQueueable
interface?