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