From 119966076222901579efa4b5378e227baff35de9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 10 Oct 2017 11:18:01 +0300 Subject: xmpp: add real message to resource-constraint test --- .../src/test/java/com/juick/xmpp/server/XMPPServerTests.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'juick-xmpp/src/test') diff --git a/juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java b/juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java index fde88787..ccc4f1d4 100644 --- a/juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java +++ b/juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java @@ -19,6 +19,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; import rocks.xmpp.addr.Jid; import rocks.xmpp.core.stanza.model.Message; +import rocks.xmpp.core.stanza.model.Stanza; import rocks.xmpp.core.stanza.model.StanzaError; import rocks.xmpp.core.stanza.model.errors.Condition; import rocks.xmpp.core.stanza.model.server.ServerMessage; @@ -63,13 +64,10 @@ public class XMPPServerTests { } @Test public void botIsUpAndProcessingResourceConstraints() { - StanzaError stanzaError = new StanzaError(StanzaError.Type.CANCEL, Condition.RESOURCE_CONSTRAINT); - Message msg = ServerMessage.from(new Message()); - msg.setType(Message.Type.ERROR); - msg.addExtension(stanzaError); - Jid from = Jid.of("localhost"); - msg.setFrom(from); + String xmlMessage = "Reply by @LexXПохоже нынче можно публично заявлять о своем веганстве. Your contact offline message queue is full. The message has been discarded."; + Jid from = Jid.of("renha@bitcheese.net"); when(userService.setActiveStatusForJID(from.toEscapedString(), UserService.ActiveStatus.Inactive)).thenReturn(true); - bot.incomingMessage(msg); + Stanza msg = server.parse(xmlMessage); + bot.incomingMessage((ServerMessage)msg); } } -- cgit v1.2.3