3

So we use after insert trigger on "LogoutEventStream" for some actions on logout.

My question is about, how to write tests for this? How do we call the insert record on LogoutEventStream?

Here's the link to the actual trigger https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_logouteventstream.htm

2
1

here is the solution for unitTest:

Test.statTest();    
EventBus.publish(new LogoutEventStream());
Test.stopTest();

Hope this helps others with same issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.