aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-09 19:24:49 +0300
committerGravatar Vitaly Takmazov2018-04-09 19:24:49 +0300
commita8094e3b0e3c81d8f77f9ccf07d2d5903a4ff5fa (patch)
tree0175256f4ad3900b8f9f39ed139618fab15f8cbf /juick-server/src/test/java/com/juick/server
parent7eb191f93473f61febeb8bd195fc1b3127cfcc6d (diff)
fix events from web
Diffstat (limited to 'juick-server/src/test/java/com/juick/server')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java8
1 files changed, 8 insertions, 0 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 358fac3d..3e17ebce 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
@@ -565,6 +565,14 @@ public class ServerTests {
xmppMessage.setBody("What's up?");
result = router.incomingMessage(xmppMessage);
assertThat(result.getBody(), startsWith("Private message sent"));
+ xmppMessage.setFrom(botJid);
+ xmppMessage.setTo(botJid.withLocal("pm"));
+ Message pm = new Message();
+ pm.setUser(userService.getUserByJID(from.toEscapedString()));
+ pm.setTo(userService.getUserByUID(secretlySadId).orElseThrow(IllegalAccessError::new));
+ xmppMessage.addExtension(pm);
+ result = router.incomingMessage(xmppMessage);
+ // TODO: assert events
}
@Test
public void botCommandsTests() throws Exception {