Is there a way to check if being run in RestResource Context? I have a script that posts messages to an endpoint but we can end up in an infinite loop scenario as they are now posting their comments to us. How can I check for this flag or flag this during runtime?
Ideally something like:
Test.isRunningTest()