What is a possible ...
 
Notifications
Clear all

What is a possible solution?

1 Posts
1 Users
0 Likes
113 Views
Giovanni
(@ferronigiovanni)
Noble Member
Joined: 7 months ago
Posts: 363
Topic starter  

A developer has working business logic code, but sees the following error in the test class:

You have uncommitted work pending. Please commit or rollback before calling out .

What is a possible solution?

  • A . Rewrite the business logic and test classes with ©TestVisible set on the callout.
  • B . Set seeAIIData to "true" at the top of the test class, since the code does not fail in practice.
  • C . Call support for help with the target endpoint, as it is likely an external code error.
  • D . Use test.IsRunningTest() before making the callout to bypass it in test execution.

Show Answer Hide Answer

Suggested Answer: D

   
Quote
Share: