Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Salesforce Certified Platform Developer II (PDII) · Salesforce
Select 2 answers.
This question asks for 2 answers, but our data marks only 1. Compare with the community discussion below for the full answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
A. Simulate user interaction by leveraging Test.setMock() If the controller interacts with external systems or APIs, using Test.setMock() is a best practice to simulate responses during testing. This ensures tests are isolated and do not depend on external systems. D. Set query parameters by using getParameters().put The example provided demonstrates setting query parameters (e.g., error parameters for the "Failure" page) using getParameters().put. This is essential when testing controllers where page logic depends on query parameters.