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
moebius43moebius43 

apex test class w "modify all" permission

To make a test class pass, our developer consultant has given "modify all" permission.  Is this really acceptable?  I am a sys admin - so I have a lot to learn here!
Please comment, or suggest resources for me to read.
Best Answer chosen by moebius43
GovindarajGovindaraj
Hi Maureen,

Ultimately, test class shouldn't rely on records in org.

We should create test data using @testsetup(preferred) or utility classes.Otherwise, when a metadata get introduced (like validation rule, trigger etc) test class may fail.

Thanks,
Govindaraj.S

All Answers

GovindarajGovindaraj
Hi Maureen,

Ultimately, test class shouldn't rely on records in org.

We should create test data using @testsetup(preferred) or utility classes.Otherwise, when a metadata get introduced (like validation rule, trigger etc) test class may fail.

Thanks,
Govindaraj.S
This was selected as the best answer
GovindarajGovindaraj
Hi Maureen,

Please keep this community clean by closing solved cases.

Thanks,
Govindaraj.S
moebius43moebius43
Govindaraj,
Thank you very much!
Maureen