+ Start a Discussion

Test class for logout event stream?

trigger LogoutEventTrigger on LogoutEventStream (after insert) {
    LogoutEventStream event = Trigger.new[0];
    String EventjsonString = json.serialize(Trigger.new[0]);
Agustin BAgustin B
Hi lalitarora, try with this code please:
    private static void test(){
EventBus.publish(new LogoutEventStream());

If it helps please like and mark as correct, it may help others.
상일 정 3상일 정 3

Hi Agustin,

When I wrote a test class about LogoutEventStream, I got an error below.
System.TypeException: DML operation INSERT not allowed on LogoutEventStream
I definitely use the code 'EventBus.publish(new LogoutEventStream());'

What's the problem?