scheduled-apex
Apex test class for schedulable class that checks for 5 batches running already
I’ve setup some chain execution batch classes. For this setup we decided to chain the batch classes through schedulable classes. We thought it might be a good idea to include a check for 5 batch jobs running so we didn’t hit the concurrent batch processing limit. Here’s the method we put into our schedulable classes:
Salesforce: Is there any way to set System time in test class
So I have a trigger and a schedule class. The trigger will fire upon update on an object and schedule a job which will execute the scheduled class. There is some logic in the trigger related to non-working hours, weekends and holidays. It will usually schedule the job 1 hour after insert (due to business requirement). but if insert happens over the weekend, afterhours, or holidays. It will schedule the next business day 8am.