Summer Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: pass65

Exam PDII All Questions
Exam PDII All Questions

View all questions & answers for the PDII exam

Salesforce Developers PDII Question # 9 Topic 1 Discussion

PDII Exam Topic 1 Question 9 Discussion:
Question #: 9
Topic #: 1

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.

Which step should be taken to resolve the error?


A.

Ensure both the Insertion and mock callout occur after the I==L. stoptest_().


B.

Ensure the records are Inserted before the Tezt.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().


D.

Ensure the records are inserted before the Test.startTess() statement and the mock callout occurs after the Test. Startest().


Get Premium PDII Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.