aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-14 15:04:16 +0300
committerGravatar Vitaly Takmazov2018-06-14 15:04:16 +0300
commitca37c96de0f2a5beb097f560949ecfaeb7a86880 (patch)
tree3f4b54e26450f6f65bebdfd8f3caa8160f138484 /juick-server/src/test
parent2236eee046e3ce304a3adcd9305ae6d6d2555003 (diff)
Do not initialize telegram bot when token is missing
Diffstat (limited to 'juick-server/src/test')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java13
1 files changed, 1 insertions, 12 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 d700b909..88ce5cf3 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
@@ -57,9 +57,6 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.socket.TextMessage;
-import org.springframework.web.socket.client.WebSocketConnectionManager;
-import org.springframework.web.socket.client.standard.StandardWebSocketClient;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
import org.w3c.dom.Document;
@@ -142,8 +139,6 @@ public class ServerTests {
@Inject
private TelegramService telegramService;
@Inject
- private TelegramBotManager telegramBotManager;
- @Inject
private CrosspostService crosspostService;
@Inject
private ImagesService imagesService;
@@ -896,14 +891,8 @@ public class ServerTests {
mockMvc.perform(post("/react?mid=" + mid1 + "&hash=" + freefdHash+ "&reactionId=1"))
.andExpect(status().isOk());
assertThat(messagesService.getMessage(mid1).getLikes(), is(1));
- }
-
- @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\"}}}");
}
+
@Test
public void lastReadTests() throws Exception {
int mid = messagesService.createMessage(ugnich.getUid(), "to be watched", null, null);