Skip to navigation

TestUtils

View as Markdown
@IsTest global class TestUtils
Description
Utility methods to support unit testing.

Methods

global static HttpCalloutMock setMock(final HttpCalloutMock mock)
Description
Sets an HTTP callout mock for a unit test. This method must be called from external code requiring use of the Docusign REST API mocks instead of calling Test.setMock directly.
Returns
The HTTP callout mock.
Parameters
mock
final HttpCalloutMock mock
An instance of a class implementing the HttpCalloutMock interface.
global static WebServiceMock setMock(final WebServiceMock mock)
Description
Sets an SOAP callout mock for a unit test. This method must be called from external code requiring use of the Docusign SOAP API mocks instead of calling Test.setMock directly.
Returns
The SOAP callout mock.
Parameters
mock
final WebServiceMock mock
An instance of a class implementing the WebServiceMock interface.