mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-24 03:27:59 +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.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(
|
||||
|
|
Loading…
Reference in a new issue