mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 00:02:06 +01:00
test: created mocked connectionwith stanza factory
This commit is contained in:
parent
4b01892129
commit
36072fb25a
1 changed files with 5 additions and 0 deletions
|
@ -30,6 +30,8 @@ import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||||
import org.jivesoftware.smack.filter.StanzaFilter;
|
import org.jivesoftware.smack.filter.StanzaFilter;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.Stanza;
|
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;
|
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||||
|
|
||||||
|
@ -78,6 +80,9 @@ public class ConnectionUtils {
|
||||||
when(connection.getUser()).thenReturn(initiatorJID);
|
when(connection.getUser()).thenReturn(initiatorJID);
|
||||||
when(connection.getXMPPServiceDomain()).thenReturn(xmppServer);
|
when(connection.getXMPPServiceDomain()).thenReturn(xmppServer);
|
||||||
|
|
||||||
|
final StanzaFactory stanzaFactory = new StanzaFactory(new StandardStanzaIdSource());
|
||||||
|
when(connection.getStanzaFactory()).thenReturn(stanzaFactory);
|
||||||
|
|
||||||
// mock packet collector
|
// mock packet collector
|
||||||
final StanzaCollector collector = mock(StanzaCollector.class);
|
final StanzaCollector collector = mock(StanzaCollector.class);
|
||||||
when(connection.createStanzaCollector(isA(StanzaFilter.class))).thenReturn(
|
when(connection.createStanzaCollector(isA(StanzaFilter.class))).thenReturn(
|
||||||
|
|
Loading…
Reference in a new issue