function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ryan Werner 22Ryan Werner 22 

Abstracted continuation test class

Hello-

I have created a structure to change our syncrhonous callouts to asyncrhonous using a continuation. We also are using Apex remoting. I have an abstract class which contains a method called "callbackCheck". The class which extends from this contains the remote methods that return the continuation. The callback always first goes to the callback check on the abstract class, and then once it verifies a valid response, it then invokes the proper callback for that specific service.

The issue I'm having is with writing the test class. When this runs, it cannot find the "callbackCheck" method. The "ctrl" is the controller which is abstracted from the abstract class, so the test is complaining it can't find "callbackCheck" on the controller:
Object result = Test.invokeContinuationMethod(ctrl, conti);
I cannot construct an abstract class so I cannot pass it instead of ctrl.

Is there anyway the continuation can view the callbackCheck on the abstract class?

Thanks!