As part of the Subscription Management license, certain platform events are fired when an Asset is updated, an Invoice is processed etc.

For example the CreateAssetOrderEvent.

Currently we are using an Apex platform event trigger to process this event, which works perfectly in the org.

The issue is that we require at least one line of the trigger to be covered by unit tests in order to deploy to production, and it is impossible to do that because:

  1. A CreateAssetOrderEvent cannot be inserted via Apex
  2. A CreateAssetOrderEvent cannot be published as part of an EventBus.publish() call
  3. A CreateAssetOrderEvent cannot be triggered indirectly because it can only be triggered by an API call to /actions/standard/createOrUpdateAssetFromOrder, and test methods cannot make API calls, only mock them.
  4. Triggers do not support any static variables or methods, and we cannot directly invoke them.

Is there any workaround other than switching from an Apex trigger subscriber to a flow subscriber?



You must log in to answer this question.