You need to sign in to do that
Don't have an account?
shravani mil
unable to cover @future method in test class
unable to cover this method in my test class
@future (callout=true)
public static void syncToS(Set<Id> oppIDs){
List<Log__c> errLogs = new List<Log__c>();
for (Id oppId : oppIDs) {
try {
GenerateOpptyStageSync.OpptyStageSync(String.valueOf(oppId),'');
}
catch(Exception ex) {
()
}
}
if (errLogs.size() > 0)
insert errLogs;
}
@future (callout=true)
public static void syncToS(Set<Id> oppIDs){
List<Log__c> errLogs = new List<Log__c>();
for (Id oppId : oppIDs) {
try {
GenerateOpptyStageSync.OpptyStageSync(String.valueOf(oppId),'');
}
catch(Exception ex) {
()
}
}
if (errLogs.size() > 0)
insert errLogs;
}
Put call to the future method inside startTest/stopTest: Remember , Test.stopTest() does not return until your future method has completed.
Hope this will help you.
Regards,
Akshay