Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Salesforce logo

SalesforceCertified Platform Developer II

Domain 7Objective 1

Describe the Best Practices for Unit Testing in Apex. PLATFORM-DEVELOPER-II Practice Questions (Page 1)

Part of the TESTING domain, which accounts for 7% of the PLATFORM-DEVELOPER-II exam.

31questions here
7free pages
10concepts
7%of the exam

Questions 1–5

  1. 1application · medium

    A developer is writing a test for a trigger that sets the OwnerId of an Account to the running user when the Account is inserted. The test must verify that the trigger works correctly for a standard user. Which test pattern should the developer use?

    Select an answer first
  2. 2foundation · easy

    Which method is used to retrieve the number of SOQL queries that have been used in the current transaction?

    Select an answer first
  3. 3foundation · easy

    What is the primary purpose of using Test.startTest() and Test.stopTest() in an Apex test method?

    Select an answer first
  4. 4application · medium

    A developer is writing a test for a class that makes an HTTP callout to an external weather API. The class parses the JSON response and returns the temperature. The developer wants to verify the parsing logic without making a real network call. Which approach should the developer use?

    Select an answer first
  5. 5foundation · easy

    Which annotation can be used on a test method to indicate that it expects a specific exception to be thrown?

    Select an answer first
Finished these 5 questions?

Review the revealed explanations, or continue through the curriculum.

Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by Salesforce. “PLATFORM-DEVELOPER-II” is a trademark of its owner, used for identification only.