問題文
A harbor pilot service's Visualforce controller starts a long-running request to a berth scheduling service and continues in a callback. The developer must cover the callback in an Apex test without any traffic leaving the org. What does the test have to do?
選択肢
- Call the callback method directly with a hand-built response, because the framework cannot be driven from a test and only the callback's own logic can be covered that way.
- Set a mock response against the request's label, then invoke the continuation method so that the callback runs and its own return value can be examined.
- Register a callout mock before the action method runs, because a continuation is just a callout with a different syntax, and the callback receives the mocked body as soon as the request resolves itself.
- Wrap the action method in the test boundary methods and then query the asynchronous job table to confirm that the request completed, because a continuation is queued like any other asynchronous work and resumes once the boundary closes.