A developer has a test class that creates test data before making a mock callout but now receives a 'You have uncommitted work pending. Please commit or rollback before calling out' error.
Ah, the old 'You have uncommitted work pending' error. Brings back memories of that time I accidentally committed my entire life savings. Good times, good times.
I disagree, I believe the answer is D. The records should be inserted before Test.startTest() and the mock callout should occur after Test.startTest().
I think the correct step is B, because the records need to be inserted before Test.startTest() and the mock callout should be within a method annotated with @testSetup.
upvoted 0 times
...
Log in to Pass4Success
Sign in:
Report Comment
Is the comment made by USERNAME spam or abusive?
Commenting
In order to participate in the comments you need to be logged-in.
You can sign-up or
login
Bernadine
28 days agoHildegarde
29 days agoKathrine
5 days agoXenia
6 days agoQuentin
11 days agoDonte
1 months agoGertude
1 months agoCory
3 days agoSophia
4 days agoKattie
7 days agoCarey
10 days agoShonda
11 days agoMaricela
18 days agoChun
1 months agoAmalia
1 months agoChun
2 months ago