Salesforce PDII Question Answer
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?
Salesforce PDII Summary
- Vendor: Salesforce
- Product: PDII
- Update on: Dec 26, 2025
- Questions: 161

