aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-09 19:03:53 +0300
committerGravatar Vitaly Takmazov2018-04-09 19:03:53 +0300
commit7eb191f93473f61febeb8bd195fc1b3127cfcc6d (patch)
tree3cde97dd636719046555f757f55d756b8e9da145 /juick-server
parent66fd14b44044b2b8004ddd73789345e5c7f26ae2 (diff)
server: xmpp pm tests
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
index 43bc119e..358fac3d 100644
--- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
@@ -532,10 +532,10 @@ public class ServerTests {
}
@Test
public void botIsUpAndProcessingResourceConstraints() throws Exception {
- int renhaId;
- renhaId = userService.createUser("renha", "umnnbt");
+ int renhaId = userService.createUser("renha", "umnnbt");
Jid from = Jid.of("renha@serverstorageisfull.tld");
- jdbcTemplate.update("INSERT INTO jids(user_id,jid,active) VALUES(?,?,?)", renhaId, from.toEscapedString(), 1);
+ jdbcTemplate.update("INSERT INTO jids(user_id,jid,active) VALUES(?,?,?)",
+ renhaId, from.toEscapedString(), 1);
rocks.xmpp.core.stanza.model.Message xmppMessage = new rocks.xmpp.core.stanza.model.Message();
xmppMessage.setType(rocks.xmpp.core.stanza.model.Message.Type.ERROR);
xmppMessage.setFrom(from);
@@ -560,6 +560,11 @@ public class ServerTests {
xmppMessage.setBody("PING");
result = router.incomingMessage(xmppMessage);
assertThat(result.getBody(), equalTo("PONG"));
+ int secretlySadId = userService.createUser("secretlysad", "bbk");
+ xmppMessage.setTo(botJid.withLocal("secretlysad"));
+ xmppMessage.setBody("What's up?");
+ result = router.incomingMessage(xmppMessage);
+ assertThat(result.getBody(), startsWith("Private message sent"));
}
@Test
public void botCommandsTests() throws Exception {