Mockout class for test in apex code

Hello,

I need to implement a test class in salesforce to cover the code of another class that uses a APICall to purecloud.SDK.

Does anyone know what the mockcallout class is called in purecloud.sdk?
I have tried to put the standard class but it does not work, it returns an error that a test class cannot make Callout calls.
The class has the following code
I have a campaign member insertion class in Genesys automatically that makes this call:
public static ResultGenesysToolkit insertCampaignMember (List lMember, Boolean priority) {
//Load parameters on variables....
response = purecloud.SDK.Rest.post(URL,JSON.serialize(lObject));

from another @invocable class, I call a @future method to make the call to

// call to Genesys
lResult = GenesysToolkit.insertCampaignMember(lInsert, w.priority);

Any help with this?

Thanks in advance

I found this Salesforce documentation.

Salesforce developer doc: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_testing_static.htm

To mock a callout if the code that performs the callout is in a managed package, call Test.setMock from a test method in the same package with the same namespace.

So it seems today that there is no way to mock a callout made by the Genesys Cloud for Salesforce managed package as the package does not currently provide a way to call Test.setmock in the same package with the same namespace.

Junji

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.