GlobalRestHelper Class
This article describes the GlobalRestHelper
class. This class provides methods to facilitate making REST calls to Zuora using the configuration in 360.
GlobalRestHelper Methods
The GlobalRestHelper
class includes the following methods.
Method Signature | Description |
---|---|
global String getServerUrl() |
Returns a String of the endpoint URL configured in 360. |
global static zApi.HttpCalloutMockImplementation mockRestHelper() |
Returns a zApi.HttpCalloutMockImplementation and mocks out the sendRequest() . This method allows the exposed REST methods to be mocked out for testing purposes. You can set the body of the zApi.HttpCalloutMockImplementation to get a mocked out response. |
Sample Code
Zuora.GlobalRestHelper.mockRestHelper().setMockRestResponseBody(' {"success" : true,"content" : "Your content Json"} ');