diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java index 52bc20deb..b130eddce 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java @@ -38,7 +38,6 @@ import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Verification; import org.junit.Before; import org.junit.Test; -import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; @@ -52,7 +51,6 @@ public class InBandBytestreamManagerTest extends InitExtensions { // settings private static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; private static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; - private static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; String sessionID = "session_id"; // protocol verifier @@ -74,8 +72,7 @@ public class InBandBytestreamManagerTest extends InitExtensions { protocol = new Protocol(); // create mocked XMPP connection - connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID, - xmppServer); + connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID); } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionMessageTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionMessageTest.java index ba2f9fb78..92863ed1c 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionMessageTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionMessageTest.java @@ -43,7 +43,6 @@ import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Verification; import org.junit.Before; import org.junit.Test; -import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.powermock.reflect.Whitebox; @@ -60,7 +59,6 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions { // settings private static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; private static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; - private static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; private static final String sessionID = "session_id"; private static final int blockSize = 10; @@ -90,7 +88,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions { protocol = new Protocol(); // create mocked XMPP connection - connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID, xmppServer); + connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID); // initialize InBandBytestreamManager to get the InitiationListener byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionTest.java index 9282bf18d..425cffe2e 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionTest.java @@ -43,7 +43,6 @@ import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Verification; import org.junit.Before; import org.junit.Test; -import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.powermock.reflect.Whitebox; @@ -61,7 +60,6 @@ public class InBandBytestreamSessionTest extends InitExtensions { // settings private static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; private static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; - private static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; private static final String sessionID = "session_id"; private static final int blockSize = 10; @@ -91,7 +89,7 @@ public class InBandBytestreamSessionTest extends InitExtensions { protocol = new Protocol(); // create mocked XMPP connection - connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID, xmppServer); + connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID); // initialize InBandBytestreamManager to get the InitiationListener byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java index 53dc4b17c..6d96bcedc 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java @@ -68,7 +68,7 @@ public class Socks5ByteStreamManagerTest { // settings private static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; private static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; - private static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; + private static final DomainBareJid xmppServer = initiatorJID.asDomainBareJid(); private static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; private static final String proxyAddress = "127.0.0.1"; private static final String sessionID = "session_id"; @@ -92,7 +92,7 @@ public class Socks5ByteStreamManagerTest { protocol = new Protocol(); // create mocked XMPP connection - connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID, xmppServer); + connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID); } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java index bcbe0105d..371df7597 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java @@ -57,7 +57,6 @@ public class Socks5ByteStreamRequestTest { // settings private static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; private static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; - private static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; private static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; private static final String proxyAddress = "127.0.0.1"; private static final String sessionID = "session_id"; @@ -79,7 +78,7 @@ public class Socks5ByteStreamRequestTest { protocol = new Protocol(); // create mocked XMPP connection - connection = ConnectionUtils.createMockedConnection(protocol, targetJID, xmppServer); + connection = ConnectionUtils.createMockedConnection(protocol, targetJID); } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java index 86ea9e48b..744ffcd9e 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java @@ -58,7 +58,6 @@ public class Socks5ClientForInitiatorTest { // settings private static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; private static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; - private static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; private static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; private static final String loopbackAddress = InetAddress.getLoopbackAddress().getHostAddress(); @@ -86,7 +85,7 @@ public class Socks5ClientForInitiatorTest { protocol = new Protocol(); // create mocked XMPP connection - connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID, xmppServer); + connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID); } /** diff --git a/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java b/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java index 3c489f525..097f2fefc 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java +++ b/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java @@ -63,14 +63,15 @@ public class ConnectionUtils { * * @param protocol protocol helper containing answer packets * @param initiatorJID the user associated to the XMPP connection - * @param xmppServer the XMPP server associated to the XMPP connection * @return a mocked XMPP connection * @throws SmackException * @throws XMPPErrorException * @throws InterruptedException */ public static XMPPConnection createMockedConnection(final Protocol protocol, - EntityFullJid initiatorJID, DomainBareJid xmppServer) throws SmackException, XMPPErrorException, InterruptedException { + EntityFullJid initiatorJID) throws SmackException, XMPPErrorException, InterruptedException { + + DomainBareJid xmppServer = initiatorJID.asDomainBareJid(); // mock XMPP connection XMPPConnection connection = mock(XMPPConnection.class);