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
SimrinSimrin 

test class for static methods

global class RecurringScheduleJob{
    public static void startJob(){
        String str = 'Job Started at : ' + system.now();
    }
}
I was writing test class for this class but as it is static , i am not allowed to to call static method.

any suggestions ?
Best Answer chosen by Simrin
David ZhuDavid Zhu
The following code works on my sandbox.

@istest
public class RecurringScheduleJob_Test{
    private static testmethod void test()
    {
        RecurringScheduleJob.startJob();
    }
}