I'm struggling with writing apex unit tests for my new Messaging Channel. I just configured Facebook Messenger as new messaging channel for existing OmniChannel.

When someone is starting conversation on Facebook fanpage, along with new record of MessagingSession, new related Case is being created. Once the chat is ended, I'm trying to automatically close related Case (set status to "Closed").
Unfortunatelly my logic doesn't work so I wanted to write apex test in order to debug what's going on (way easier than starting and ending chats all the time).

Question is - how to end messaging session in unit test? Neither status nor EndTime fields are writeable on MessagingSession. I was trying to do it from AgentWork context but with no success. Any idea how to solve it?


You must log in to answer this question.

Browse other questions tagged .