Timeline for Testing a trigger calling batch class for making a callout gives System.CalloutException
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 29, 2019 at 15:01 | vote | accept | Raul | ||
Jul 29, 2019 at 14:44 | comment | added | Raul |
Its a shame that this doesn't work, thanks for your answer and better insight. Test.isRunningTest() works but I try to avoid it, unfortunately not in this case. For end to end testing I guess I can call a future method instead of batch from trigger for test context
|
|
Jul 29, 2019 at 13:11 | comment | added | David Reed |
@Raul I don't think you need to use Test.isRunningTest() (although I might be wrong) - I think if you just don't use Test.startTest() while executing the trigger you'll be able to get it through. And yeah, test the trigger and batch separately.
|
|
Jul 29, 2019 at 13:09 | comment | added | Raul |
So I have to basically use Test.isRunningTest() in trigger to skip batch call, then test trigger and batch separately?
|
|
Jul 29, 2019 at 11:41 | history | answered | David Reed | CC BY-SA 4.0 |