You need to sign in to do that
Don't have an account?
Óli Þór Gunnarsson
Failed to run tests synchronously.: java.lang.reflect.InvocationTargetException
Hi all,
We are using Platform events and trigger on platform event as subscriber. Test Class for one of several Event triggers is now generating error.
We used to have several functions in one Apex test class and only one of the functions has errors. I tried removing that function to separate apex test class and then the others run successfully but this one is still not working.
When we run the test it generates error with the message: "Failed to run tests synchronously.: java.lang.reflect.InvocationTargetException".
Lines causing error: "Test.getEventBus().deliver();"
I have had hard time to find information about what might be causing this...
We are using Platform events and trigger on platform event as subscriber. Test Class for one of several Event triggers is now generating error.
We used to have several functions in one Apex test class and only one of the functions has errors. I tried removing that function to separate apex test class and then the others run successfully but this one is still not working.
When we run the test it generates error with the message: "Failed to run tests synchronously.: java.lang.reflect.InvocationTargetException".
Lines causing error: "Test.getEventBus().deliver();"
I have had hard time to find information about what might be causing this...
Do you have flows involved in this functionality?
Related: https://salesforce.stackexchange.com/questions/350108/how-to-test-platform-event-trigger-flow/375172#375172
Thanks
There are no flows that are subscribed to the event, only Apex Trigger is subscribed.
Thanks