Salesforce Platform Developer II Exam

© examsiri.com
Question : 4 of 33
 
Marks: +1, -0
@isTest
Static void TestAccountUpdate() {
  Account acct = new Account(Name = 'Test');
  acct.Integration_Updated__c = false;
  insert acct;

  CalloutUtil.sendAccountUpdate (acct.Id);

  Account acctAfter = [SELECT Id, Integration_Updated__c FROM ACCOUNT WHERE Id = :acct.Id] [0];
  System.assert(true, acctAfter.Intergration_Updated__c);
}

The test method above calls a web service that updates an external system with Account information and sets the Account’s Integration_Updated__c checkbox to True when it completes. The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts. "What is the optimal way to fix this?
Go to Question: