mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-01-02 07:57:59 +01:00
[sinttest] Use MultiUserChat.getMyRoomJid() in integration test
This commit is contained in:
parent
e530db2e6d
commit
b3637101ce
1 changed files with 8 additions and 3 deletions
|
@ -35,7 +35,7 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
|
||||||
import org.igniterealtime.smack.inttest.TestNotPossibleException;
|
import org.igniterealtime.smack.inttest.TestNotPossibleException;
|
||||||
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
|
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
|
||||||
import org.jxmpp.jid.EntityBareJid;
|
import org.jxmpp.jid.EntityBareJid;
|
||||||
import org.jxmpp.jid.impl.JidCreate;
|
import org.jxmpp.jid.EntityFullJid;
|
||||||
import org.jxmpp.jid.parts.Resourcepart;
|
import org.jxmpp.jid.parts.Resourcepart;
|
||||||
|
|
||||||
public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatIntegrationTest {
|
public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatIntegrationTest {
|
||||||
|
@ -176,12 +176,17 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
|
||||||
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
|
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
|
||||||
final Resourcepart nicknameOne = Resourcepart.from("one-" + randomString);
|
final Resourcepart nicknameOne = Resourcepart.from("one-" + randomString);
|
||||||
createMuc(mucAsSeenByOne, nicknameOne);
|
createMuc(mucAsSeenByOne, nicknameOne);
|
||||||
|
final EntityFullJid mucAsSeenByOneUserJid = mucAsSeenByOne.getMyRoomJid();
|
||||||
|
// Ensure that we do not invoke discoverItems() with null below. This should not happen, as the room JID should
|
||||||
|
// be non-null after we created and joined the room. But it can not hurt to explicitly test for it either.
|
||||||
|
if (mucAsSeenByOneUserJid == null) {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
|
||||||
XMPPException.XMPPErrorException xe;
|
XMPPException.XMPPErrorException xe;
|
||||||
try {
|
try {
|
||||||
xe = assertThrows(XMPPException.XMPPErrorException.class,
|
xe = assertThrows(XMPPException.XMPPErrorException.class,
|
||||||
() -> ServiceDiscoveryManager.getInstanceFor(conTwo).discoverItems(
|
() -> ServiceDiscoveryManager.getInstanceFor(conTwo).discoverItems(mucAsSeenByOneUserJid));
|
||||||
JidCreate.entityFullFrom(mucAddress, nicknameOne), null));
|
|
||||||
} finally {
|
} finally {
|
||||||
tryDestroy(mucAsSeenByOne);
|
tryDestroy(mucAsSeenByOne);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue