Apex Test Method for Removing Scheduled Batches
Don't you really dislike when you go to deploy some code to a production Salesforce org and it fails because you forgot to unschedule a batch class? This is especially frustrating in a larger org where there is lots of code running and the deployment takes a long time due to the large number of @isTest methods that need to be run. I thought I would share some code that I wrote, which will remove any scheduled batch jobs and, therefore, avoid any issues with deployments in your orgs. Besides, who doesn't want to see more examples of @isTest Apex methods? [...]