From 5cbcd676457ca9429f3788ab7e77681171fbc50d Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 1 Jun 2024 12:14:02 +0200 Subject: [PATCH] [sinttest] Add MultiUserChatIntegrationTest.mucTestChangeRoomName --- .../muc/MultiUserChatIntegrationTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java index 5d938bff5..9dcd73e68 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java @@ -193,4 +193,30 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati tryDestroy(mucAsSeenByOne); } } + + @SmackIntegrationTest + public void mucTestChangeRoomName() throws XmppStringprepException, MucAlreadyJoinedException, + MissingMucCreationAcknowledgeException, NotAMucServiceException, NoResponseException, + XMPPErrorException, NotConnectedException, InterruptedException, TestNotPossibleException { + final EntityBareJid mucAddress = getRandomRoom("smack-inttest-change-room-name"); + final MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress); + final Resourcepart nicknameOne = Resourcepart.from("one-" + randomString); + + createMuc(mucAsSeenByOne, nicknameOne); + try { + String initialRoomName = "Initial Room Name"; + mucAsSeenByOne.getConfigFormManager().setRoomName(initialRoomName).submitConfigurationForm(); + RoomInfo roomInfo = mucManagerOne.getRoomInfo(mucAddress); + assertEquals(initialRoomName, roomInfo.getName()); + + String newRoomName = "New Room Name"; + mucAsSeenByOne.getConfigFormManager().setRoomName(newRoomName).submitConfigurationForm(); + roomInfo = mucManagerOne.getRoomInfo(mucAddress); + assertEquals(newRoomName, roomInfo.getName()); + } catch (MucConfigurationNotSupportedException e) { + throw new TestNotPossibleException(e); + } finally { + tryDestroy(mucAsSeenByOne); + } + } }