A developer has a test class that creates test data before making a mock call-out, but now receives a `˜You have uncommitted work pending. Please commit or rollback before calling out' error. What step should be taken to resolve the error?
A.
Ensure both the insertion and mock callout occur after the Test.startTest()
B.
Ensure both the insertion and mock callout occur after the Test.stopTest()
C.
Ensure the records are inserted before the Test.startTest() statement and the mock callout occurs within a method annotated with @testSetup
D.
Ensure the records are inserted before the Test.startTest() statement and the mock callout after the Test.startTest()
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Comments