View Mode
Q: 11
Consider the following code snippet: apex CopyEdit public class with sharing AccountsController { @AuraEnabled public List getAllAccounts(){ return [SELECT Id, Name, Industry FROM Account]; } } Apex Test Class Snippet: apex CopyEdit @isTest private class with sharing AccountsController_Test { @testSetup private static void makeData(){ User user1 = [SELECT Id FROM User WHERE Profile.Name = 'System Administrator' AND isActive = true LIMIT 1]; User user2 = [SELECT Id FROM User WHERE Profile.Name = 'Standard User' AND UserName = '[email protected]' AND isActive = true LIMIT 1]; TestUtils.insertAccounts(10, user1.Id); TestUtils.insertAccounts(20, user2.Id); } @isTest private static void getAllAccounts_StandardUser_Test(){ List result = AccountsController.getAllAccounts(); System.assertEquals(20, result.size()); } } When the test class runs, the assertion fails. Which change should the developer implement in the Apex test method to ensure the test method executes successfully?
Options
Question 11 of 30

Premium Access Includes

  • ✓ Quiz Simulator
  • ✓ Exam Mode
  • ✓ Progress Tracking
  • ✓ Question Saving
  • ✓ Flash Cards
  • ✓ Drag & Drops
  • ✓ 3 Months Access
  • ✓ PDF Downloads
Get Premium Access
Scroll to Top

FLASH OFFER

Days
Hours
Minutes
Seconds

avail 10% DISCOUNT on YOUR PURCHASE