ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 257 - Certified Platform Developer II discussion

Report
Export

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 callout 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.stopTest().
Answers
A.
Ensure both the insertion and mock callout occur after the Test.stopTest().
B.
Ensure the records are inserted before the Test.startTest() statement and the mock callout occurs within a method annotated with @testSetup.
Answers
B.
Ensure the records are inserted before the Test.startTest() statement and the mock callout occurs within a method annotated with @testSetup.
C.
Ensure both the insertion and mock callout occur after the Test.startTest().
Answers
C.
Ensure both the insertion and mock callout occur after the Test.startTest().
D.
Ensure the records are inserted before the Test.startTest() statement and the mock callout after the Test.startTest().
Answers
D.
Ensure the records are inserted before the Test.startTest() statement and the mock callout after the Test.startTest().
Suggested answer: D
asked 23/09/2024
Mehr Khan
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first