You need to sign in to do that
Don't have an account?
JamesT77
Test Trigger that contains callout
hi
i've read up on how you can test callout code (Virtual Callout Testing) and tried to use it within a trigger.
However this code does not work when you try to call it within a trigger.
To fire the callout method within the trigger you have to fire it asynchronously using the @Future tag and the method has to be static also. This breaks the virtual classes.
Has anyone got the Virtual Callout Testing code to work within a trigger also?
In your testmethod, did you use the Test.startTest() and Test.stopTest() methods?
To test @future methods, you need to use those. See the Apex doc for more information.