1

Error occured in my test file:Methods defined as TestMethod do not support Web service callouts, test skipped.

@isTest(SeeAllData=true)

public class REST_Upsell_Controller_Test {

    static testMethod void testCreateNewUpsell(){
        Test.startTest();
        string orderId = 'a0555000000N5BnAAK';
        REST_Upsell_Controller.processUpsell('a0555000000N5BnAAK');
        ChargentOrders__ChargentOrder__c order = [SELECT Id, ChargentOrders__Charge_Amount__c, ChargentOrders__Tax__c, ChargentOrders__Subtotal__c FROM ChargentOrders__ChargentOrder__c WHERE Id = :orderId];
        order.ChargentOrders__Subtotal__c = 600.66;
            update order;
            System.assertEquals('a0555000000N5BnAAK',order.Id);

    }
}
0

1 Answer 1

0

You can't make a real webservice call during testing. You need to use WebServiceMock class to test it.

This will help I guess.

Not the answer you're looking for? Browse other questions tagged .