Câu 31: Certified Platform Developer II
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 toTrue 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…
Nội dung câu hỏi
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 toTrue 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?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. Add Test.startTest() before and Test.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.
- B. Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate. — đáp án hiện tại
- C. Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.
- D. Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.