New Year Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmasmnth

A developer wrote the following method to find all the test accounts in the org:Javapublic...

A developer wrote the following method to find all the test accounts in the org:

Java

public static Account[] searchTestAccounts() {

List> searchList = [FIND 'test' IN ALL FIELDS RETURNING Account(Name)];

return (Account[]) searchList[0];

}

However, the test method below fails.

Java

@isTest

public static void testSearchTestAccounts() {

Account a = new Account(name='test');

insert a;

Account [] accounts = TestAccountFinder.searchTestAccounts();

System.assert(accounts.size() == 1);

}

What should be used to fix this failing test?

A.

@isTest(SeeAllData=true) to access org data for the test9

B.

Test.loadData to set up expected data10

C.

Test.setFixedSearchResults() method to set up expected data11

D.

@testSetup method to set up expected data12

Salesforce PDII Summary

  • Vendor: Salesforce
  • Product: PDII
  • Update on: Dec 26, 2025
  • Questions: 161
Price: $52.5  $149.99
Buy Now PDII PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method