I've created a trigger with fields that are now in a web service callout. I've created this trigger and deployed in my org before the callout.
So now I'm getting an error: "Methods defined as TestMethod do not support Web service callouts, test skipped"
This error appears in the test class that is covering this trigger in specific.
And always when I will look for something related to this error. I found an answer that is related to web service callout, but my error is in a trigger that only have the same fields and not exactly in the web service callout.
Summarizing, I need to now how to create a test class for my trigger that have fields in a web service callout.
My trigger:
trigger AtualizarDataSeparacaoAvulso_case on Account (after update) {
Set <id> ids = new Set <id> ();
for (Account acc: trigger.new) {
if (Trigger.oldMap.get(acc.id).Data_separa_o_avulso__c != acc.Data_separa_o_avulso__c || Trigger.oldMap.get(acc.id).Data_lab_avulso__c != acc.Data_lab_avulso__c){
ids.add(acc.id);
}
}
for (Case c: [SELECT Id, motivo__c, Data_lab_avulso__c, Data_separa_o_avulso__c, Fotos_Colacao__c, Fotos_Baile__c, Fotos_Outros__c, Panoramicas__c FROM Case WHERE motivo__c = 'Impressão de álbum' AND accountid IN: ids LIMIT 1]){
for (Account acc: trigger.new) {
if(acc.Data_separa_o_avulso__c == null && Trigger.oldMap.get(acc.id).Data_separa_o_avulso__c != acc.Data_separa_o_avulso__c){
c.Data_separa_o_avulso__c = null;
}
if(acc.Data_separa_o_avulso__c != null && Trigger.oldMap.get(acc.id).Data_separa_o_avulso__c != acc.Data_separa_o_avulso__c){
c.Data_separa_o_avulso__c= acc.Data_separa_o_avulso__c;
c.Fotos_Colacao__c= acc.Fotos_Colacao__c;
c.Fotos_Baile__c=acc.Fotos_Baile__c;
c.Fotos_Outros__c=acc.Fotos_Outros__c;
c.Panoramicas__c=acc.Panoramicas__c;
}
if(acc.Data_lab_avulso__c == null && Trigger.oldMap.get(acc.id).Data_lab_avulso__c != acc.Data_lab_avulso__c){
c.Data_lab_avulso__c = null;
}
if(acc.Data_lab_avulso__c != null && Trigger.oldMap.get(acc.id).Data_lab_avulso__c != acc.Data_lab_avulso__c){
c.Data_lab_avulso__c= acc.Data_lab_avulso__c;
}
update c;
}
}
}