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
Vignesh RamshettyVignesh Ramshetty 

Need test class for below code 1

How to logout a user from test class :

trigger Logoutinfo on LogoutEventStream (after insert) {
    if(trigger.isafter == true && trigger.isinsert == true){


public class Logoutinfoclass {
    public static void Logoutinfoclassmethod(list<LogoutEventStream> listlogout){
        List <User> userList= new List <User>();

for( LogoutEventStream les:listlogout)


  for(User userInfo: [Select ID,Last_Logout__c From User where ID =: les.UserID] ) 




    update userList;

AshwiniAshwini (Salesforce Developers) 
Hi Vignesh,
You can refer below links for sample code  to write test class for LogoutEventStream: 

If this information helps, please mark the answer as best. Thank you