From 36072fb25a4dd186cf30459c9afa589ab2004a34 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 29 Oct 2019 10:40:41 +0100 Subject: [PATCH] test: created mocked connectionwith stanza factory --- .../src/test/java/org/jivesoftware/util/ConnectionUtils.java | 5 +++++ 1 file changed, 5 insertions(+) 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 cc90c29ca..910d73ee7 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java +++ b/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java @@ -30,6 +30,8 @@ import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.filter.StanzaFilter; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.Stanza; +import org.jivesoftware.smack.packet.StanzaFactory; +import org.jivesoftware.smack.packet.id.StandardStanzaIdSource; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; @@ -78,6 +80,9 @@ public class ConnectionUtils { when(connection.getUser()).thenReturn(initiatorJID); when(connection.getXMPPServiceDomain()).thenReturn(xmppServer); + final StanzaFactory stanzaFactory = new StanzaFactory(new StandardStanzaIdSource()); + when(connection.getStanzaFactory()).thenReturn(stanzaFactory); + // mock packet collector final StanzaCollector collector = mock(StanzaCollector.class); when(connection.createStanzaCollector(isA(StanzaFilter.class))).thenReturn(