diff options
Diffstat (limited to 'juick-server/src/test/java')
-rw-r--r-- | juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 13 |
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\"}}}"); + } } |