I tried so much time to get the code coverage of my class more then 75% but i am getting error (like this : Methods defined as TestMethod do not support Web service callouts, test skipped) in production organization.
The same class and same test class i have wrote in sandbox and it was working fine and get me 93% code coverage but when i am doing this same process in production i am getting error (Methods defined as TestMethod do not support Web service callouts, test skipped).
so what is the reason behind this ?
@isTest
Public class GenereatControllerTest{
static testMethod void test(){
Test.isRunningTest();
Account acc=new Account();
acc.Name='test';
insert acc;
Vendor_Order__c vo=new Vendor_Order__c();
vo.Vendor__c=acc.id;
insert vo;
Attachment atta = new Attachment();
atta.Body=Blob.valueOf('ww');
atta.Name=vo.Name+' '+Date.today().year()+Date.today().month()+Date.today().day()+'_V'+(1)+'.pdf';
atta.ParentId=vo.Id;
insert atta;
Document doc=new Document();
doc.Name=atta.Name;
doc.FolderId=userinfo.getUserId();
doc.Body=atta.Body;
insert doc;
PageReference pc = new PageReference('/apex/GenerateController?typ=send&id='+vo.id);
Test.setCurrentPage(pc);
GenerateController p = new GenerateController();
p.id=vo.Id;
p.getId();
p.init();
ApexPages.currentPage().getParameters().put('typ','save');
p = new GenerateController();
p.id=vo.Id;
p.getId();
p.init();
}
}
