aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/test/java/com')
-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 {