From eed707f39dd7a676476a3edf91619e965c235ed7 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 20 May 2024 21:58:16 +0200 Subject: [PATCH] [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. --- .../muc/AbstractMultiUserChatIntegrationTest.java | 13 +------------ .../muc/MultiUserChatOccupantIntegrationTest.java | 4 +++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java index 2ad9ca2d4..c48cbcf1b 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java @@ -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(); diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java index 077f863c2..3ceac42ac 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java @@ -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(