@SmackIntegrationTest public void testChatStateListeners() throws Exception { ChatStateManager manOne = ChatStateManager.getInstance(conOne); ChatStateManager manTwo = ChatStateManager.getInstance(conTwo); // Add chatState listeners. manTwo.addChatStateListener(composingListener); manTwo.addChatStateListener(activeListener); Chat chatOne = ChatManager.getInstanceFor(conOne) .chatWith(conTwo.getUser().asEntityBareJid()); // Test, if setCurrentState works and the chatState arrives manOne.setCurrentState(ChatState.composing, chatOne); composingSyncPoint.waitForResult(timeout); // Test, if the OutgoingMessageInterceptor successfully adds a chatStateExtension of "active" to // an outgoing chat message and if it arrives at the other side. Chat chat = ChatManager.getInstanceFor(conOne) .chatWith(conTwo.getUser().asEntityBareJid()); chat.send("Hi!"); activeSyncPoint.waitForResult(timeout); }