Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
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 23 discussion

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

A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail.
What is the optimal way for a developer to fix the issue?

  • A. Add a before insert trigger on Account to set the value of the required field.
  • B. Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.
  • C. Change the required field to be a validation rule that excludes the System Administrator profile.
  • D. Add the required field to the data setup for all of the unit tests.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Jeet89123
5 months, 2 weeks ago
Selected Answer: B
best way to create test methods
upvoted 1 times
...
VVeguru
1 year, 3 months ago
B, TestDataFactory is idela way of creating Test data at single place
upvoted 2 times
...
YNWA_A1
1 year, 3 months ago
B is correct
upvoted 1 times
...
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 ...