1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

[sinttest] Inline createLockedMuc()

This method only had one call site and using such "helper" methods has
the drawback that it is not immediatly obvious what it does when
reading the integration test code. Therefore, we better inline it.
This commit is contained in:
Florian Schmaus 2024-05-20 21:58:16 +02:00
parent c87bb8aaa4
commit eed707f39d
2 changed files with 4 additions and 13 deletions

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2021-2023 Florian Schmaus
* Copyright 2021-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -189,17 +189,6 @@ public abstract class AbstractMultiUserChatIntegrationTest extends AbstractSmack
muc.sendConfigurationForm(answerForm);
}
static void createLockedMuc(MultiUserChat muc, Resourcepart resourceName) throws
SmackException.NoResponseException, XMPPException.XMPPErrorException,
InterruptedException, MultiUserChatException.MucAlreadyJoinedException,
SmackException.NotConnectedException,
MultiUserChatException.MissingMucCreationAcknowledgeException,
MultiUserChatException.NotAMucServiceException {
muc.create(resourceName);
// Note the absence of handle.makeInstant() here. The room is still being created at this point, until a
// configuration is set.
}
static void setMaxUsers(MultiUserChat muc, int maxUsers) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, InterruptedException, SmackException.NotConnectedException {
Form configForm = muc.getConfigurationForm();
FillableForm answerForm = configForm.getFillableForm();

View file

@ -876,7 +876,9 @@ public class MultiUserChatOccupantIntegrationTest extends AbstractMultiUserChatI
final Resourcepart nicknameOne = Resourcepart.from("one-" + randomString);
final Resourcepart nicknameTwo = Resourcepart.from("two-" + randomString);
createLockedMuc(mucAsSeenByOne, nicknameOne);
// Note the absence of handle.makeInstant() here. The room is still being created at this point, until a
// configuration is set.
mucAsSeenByOne.create(nicknameOne);
try {
XMPPException.XMPPErrorException conflictErrorException = assertThrows(