You need to sign in to do that
Don't have an account?
SFDC Apex Dev
could anyone help me to write test class for the below batch class...
global class BatchClassSending implements Database.Batchable<sObject>,Database.AllowsCallouts {
global void execute(Database.BatchableContext BC,List <sObject> scope){
system.debug('scope>>>>>'+scope);
list<S_Order__c> approvedO_List = (list<S_Order__c>)scope;
set<Id> woId_List= new set<Id>();
if(System.Now().minute() > 12 && System.Now().minute() < 15 && !Test.isRunningTest() )
System.abortJob(bc.getJobId());
for(S_Order__c oObj:approvedW_List){
woId_List.add(oObj.Id);
}
if(!woId_List.isEmpty()){
P_Sending.sendingODetailOnApprovalofO(woId_List);
}
}
}
global void execute(Database.BatchableContext BC,List <sObject> scope){
system.debug('scope>>>>>'+scope);
list<S_Order__c> approvedO_List = (list<S_Order__c>)scope;
set<Id> woId_List= new set<Id>();
if(System.Now().minute() > 12 && System.Now().minute() < 15 && !Test.isRunningTest() )
System.abortJob(bc.getJobId());
for(S_Order__c oObj:approvedW_List){
woId_List.add(oObj.Id);
}
if(!woId_List.isEmpty()){
P_Sending.sendingODetailOnApprovalofO(woId_List);
}
}
}
Raj Vakati
Try this