aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-10 14:21:20 +0300
committerGravatar Vitaly Takmazov2018-04-10 14:21:20 +0300
commit4d8842d3254886b1925015e0cd24005dd927dd2a (patch)
tree211e2b180a4540d7e1f241cefabda63b4c6128fd /juick-server
parentffc282136234eeb9caf169794fd25e34ee9d5bd2 (diff)
server: add minimal telegram test
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java13
1 files changed, 9 insertions, 4 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 2644b49c..2c335cb2 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
@@ -23,10 +23,7 @@ import com.juick.ExternalToken;
import com.juick.Message;
import com.juick.Tag;
import com.juick.User;
-import com.juick.server.CommandsManager;
-import com.juick.server.EmailManager;
-import com.juick.server.XMPPConnection;
-import com.juick.server.XMPPServer;
+import com.juick.server.*;
import com.juick.server.helpers.AnonymousUser;
import com.juick.server.helpers.CommandResult;
import com.juick.server.helpers.TagStats;
@@ -123,6 +120,8 @@ public class ServerTests {
@Inject
private TelegramService telegramService;
@Inject
+ private TelegramBotManager telegramBotManager;
+ @Inject
private CrosspostService crosspostService;
@Inject
private ImagesService imagesService;
@@ -744,4 +743,10 @@ public class ServerTests {
mockMvc.perform(post("/like?mid=" + freefdMid + "&hash=" + freefdHash))
.andExpect(status().isForbidden());
}
+ @Test
+ public void telegramTests() {
+ jdbcTemplate.update("INSERT INTO telegram(user_id, tg_id) VALUES(?,1)", ugnich.getUid());
+ jdbcTemplate.update("INSERT INTO telegram_chats(chat_id) VALUES(1)");
+ telegramBotManager.processUpdate("{\"message\":{\"chat\":{\"id\":1},\"text\":\"yo\",\"from\":{\"id\":1,\"username\":\"teleugnich\"}}}");
+ }
}