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
Resample AdminResample Admin 

How to test a trigger which inserts Big Objects?

I have a trigger on a Custom Object which inserts Big Objects. These are separate objects.  

The actual Big Object insertion is done via an @future (callout=false) method.  This is due to the limitation described here:  

"Big objects don’t support transactions that include big objects, standard objects, and custom objects."
(https://developer.salesforce.com/forums/?id=9060G000000MVbgQAG)


Now, I am trying to test this trigger and @future method.  The documentation states that I should use the Stub API and Mocking Framework to do so:  

Any Apex tests that use DML calls will fail and potentially insert bad data into the target big object. This data won’t be deletable. To test DML calls, use a mocking framework with the Apex stub API to contain calls to the target big object
(https://developer.salesforce.com/docs/atlas.en-us.bigobjects.meta/bigobjects/big_object_populate_apex.htm)


However, the Stub API has a limitation that it cannot be used for @future (static) methods.  

Feel like I am going in circles here.  Is there another way to mock the @future insertion?  Or another way to decouple the custom object trigger and subsequent Big Object insertion?