Test - Isrunningtest Method
Test - Isrunningtest Method
Example:
========
Performing web service callouts in Apex are not supported within Test
Code. Hence we could use the Test.isRunningTest() to conditionally identify and
route the execution of a code block that calls the Test Mock framework to simulate
a mock, callout response.
and then test the batch class with it�s own test method.
2. Testing callouts � in our callout code we check to see if we�re executing within
a
unit test context by checking Test.isRunningTest() and instead of getting your
callout response from an HttpResponse.send() request, you return a pre-built test
string instead.