exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 230 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 230
Topic #: 1
[All Certified Platform Developer II Questions]

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()
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Currently there are no comments in this discussion, be the first to comment!
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago