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
VenkataRajaVenkataRaja 

System.runAs() is required to use when we crate user in test class.

Hi,

I created one batch class and sending email to user in finish method. For this I created one test user in in test class.
My Question is ..... Is it required to test in user mode to execute this batch class?
and Is it required to use System.runAs() whenever we are using test user in test class every time? or is there any specific reason to use System.runAs()?


Thanks 
Venkat
Ramu_SFDCRamu_SFDC
Hi Venkat, The following thread might help

https://developer.salesforce.com/forums?id=906F000000092AoIAI