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