@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 shouldStartStateAfterNegotiation() { chat.send(new Message("test message")); session.receives( "<message from='other@domain/other' to='self@domain/res' type='chat'>" + "<active xmlns='http://jabber.org/protocol/chatstates'/></message>"); final Message message = new Message(MYSELF, OTHER, "test message"); message.addChild(ChatStateManager.ChatState.active.toString(), ChatStateManager.XMLNS); chatStateManager.setOwnState(ChatStateManager.ChatState.composing); session.verifySent( message.toString() + "<message from='self@domain/res' to='other@domain/other' type='chat'>" + "<composing xmlns='http://jabber.org/protocol/chatstates'/></message>"); }