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