Certified Platform Developer II Practice Test practice questions, page 15 of 17, with answer review and explanations.
Question 71
What is a best practice when unit testing a controller? (Choose two.)
Simulate user interaction by leveraging Test.setMock()
Verify correct references by using getURL()
Access test data by using seeAllData=true
Set query parameters by using getParameters().put
Question 72
What Visualforce tag can be used to display custom messages in pages using the Salesforce UI styling for errors, warnings, and other types of messages?
<apex:customMessage>
<apex:error>
<apex:message>
<apex:pageMessage>
Question 73
A developer is working on code that requires a call to an external web service from a batch. How should the developer enable this functionality?
Implement a custom System.CalloutException class
Include Database.AllowCallout() in the class definition
Implement an @future method for the callout, and invoke it from the batch
Specify "callout=true" in the batch implementation
Question 74
A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex. How can the developer meet these requirements? (Choose two.)
Use a StandardSetController
Use CURSOR 50 in SOQL queries
Use OFFSET in SOQL queries
Use LIMIT 50 in SOQL queries
Question 75
A developer must create a way for external partners to submit millions of leads into Salesforce per day. How should the developer meet this requirement?
Publicly expose a Visualforce page via Force.com Sites
Create a web service on Heroku that uses Heroku Connect
Host a Web-to-Lead form on the company website
Publicly expose an Apex Web Service via Force.com Sites