@Test public void chatStateDontFireOnChatCreatedButMustAfterOpenChat() { final Message message = new Message(null, MYSELF, OTHER); message.addChild("gone", ChatStateManager.XMLNS); final ChatChangedTestHandler handler = addChatCreatedHandler(); session.receives(message); assertTrue(handler.isNotCalled()); manager.open(OTHER); assertTrue(handler.isCalled()); }
@Test public void roomInvitationsShouldDontFireOnChatCreatedButMustAfterOpenChat() { final ChatChangedTestHandler handler = addChatCreatedHandler(); session.receives( "<message to='" + MYSELF + "' from='someroom@domain'><x xmlns='http://jabber.org/protocol/muc#user'>" + "<invite from='" + OTHER + "'><reason>Join to our conversation</reason></invite>" + "</x><x jid='someroom@domain' xmlns='jabber:x:conference' /></message>"); assertTrue(handler.isNotCalled()); manager.open(OTHER); assertTrue(handler.isCalled()); }