A developer is asked to write helper methods that create test data for unit tests.

What should be changed in the Testutils class so that its methods are only usable by unit test methods?

What should be changed in the TestUtils class so that its methods are only usable by unit test methods?
A. Remove static from line 03.
B. Add @istest above line 01.
C. @isTest above line 03.
D. Change public to private on line 01.
正解:C
質問 2:
While working in a sandbox, an Apex test fails when run in the Test Runner. However, executing the Apex logic in the Execute Anonymous window succeeds with no exceptions or errors.
Why did the method fail in the sandbox test framework but succeed in the Developer Console?
A. The test method relies on existing data in the sandbox.
B. The test method has a syntax error in the code.
C. The test method does not use system. runAs to execute as a specific user.
D. The test method is calling an @future method.
正解:A
質問 3:
When the code executes, a DML exception is thrown.
How should a developer modify the code to ensure exceptions are handled gracefully?
A. Implement Change Data Capture.
B. Implement a try/catch block for the DML.
C. Implement the upset DML statement.
D. Remove null items from the list of Accounts.
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 4:
A company decides to implement a new process where every time an Opportunity is created, a follow up Task should be created and assigned to the Opportunity Owner.
What is the most efficient way for a developer to implement this?
A. Auto-launched flow on Task
B. Task actions
C. Record-triggered flow on Opportunity
D. Apex trigger on Task
正解:D
質問 5:
Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an additional layer of validation using automation.
What would be the best solution for this requirement?
A. Submit a REST API Callout with a JSON payload and validate the fields on a third party system
B. Use a before-save Apex trigger on the Lead object to validate the email address and display an error message if it is invalid
C. Use a custom Lightning Web component to make a callout to validate the fields on a third party system.
D. Use an Approval Process to enforce the completion of a valid email address using an outbound message action.
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 6:
What is the value of the Trigger.old context variable in a before insert trigger?
A. An empty list of sObjects
B. A list of newly created sObjects without IDs
C. null
D. Undefined
正解:C
解説: (Pass4Test メンバーにのみ表示されます)
Akahori -
模擬試験を勉強し、本番で実力が発揮できて満点合格しました。Pass4Testの専門家のおかげです。
ありがとうございました。