1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-25 03:57:58 +01:00

[sinttest] Add MultiUserChatIntegrationTest.mucTestChangeRoomName

This commit is contained in:
Florian Schmaus 2024-06-01 12:14:02 +02:00
parent b2331aaacf
commit 5cbcd67645

View file

@ -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);
}
}
}