function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Menashe Yamin 8Menashe Yamin 8 

Test classes : per trigger or per method in complicated triggers

Hello all,

I'm wondering what is the preferred way you are writing your test classes for complicated triggers.

In my project, I have a trigger that contains callout, that been implemented by a framework(need to implement an interface) in a different class, utilMethod and some regular object-specific methods (<objactName>Helper..)

My idea was that at least for the callout to create a specific test class.
But then, what should I do when I trigger the "trigger" that calls to that callout? implement it again? use only a mock to "let it go" or use the ugly "Test.isRunningTest"?

P.S.
I'm using https://github.com/kevinohara80/sfdc-trigger-framework for my trigger framework with addition that all the logic is built in a different class called triggerHelper and triggerHandler only call methods.
 
What is your approach to complicated triggers?
Thanks.