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
6 months agoHildegarde
6 months agoKathrine
5 months agoXenia
5 months agoQuentin
5 months agoDonte
6 months agoGertude
6 months agoCory
5 months agoSophia
5 months agoKattie
5 months agoCarey
5 months agoShonda
5 months agoMaricela
6 months agoChun
6 months agoAmalia
6 months agoChun
7 months ago