I want to invoke a Process from the record base Process using invocable apex which invokes Process by making an HTTP request to the Rest API. But when I try that it's causing many of our existing tests to fail because of Mock issue.
For example, Lead Object Process invokes Apex class which makes an HTTP request to the Rest API to call other Process. So in any test class where DML is performed on Lead object between Test.startTest() and Test.stopTest() gives the mock error.
Can anyone suggest what could be the best way to handle this error?
Either should I update all of the test classes to set the Mock or in the Invocable class to check if Test is running?