|
16 | 16 | import com.pengrad.telegrambot.checks.VideoNoteCheck; |
17 | 17 | import com.pengrad.telegrambot.checks.VideoTest; |
18 | 18 | import com.pengrad.telegrambot.checks.VoiceTest; |
19 | | -import com.pengrad.telegrambot.checks.WebhookInfoTest; |
20 | 19 | import com.pengrad.telegrambot.impl.TelegramBotClient; |
21 | 20 | import com.pengrad.telegrambot.model.*; |
22 | 21 | import com.pengrad.telegrambot.model.botcommandscope.BotCommandScopeAllChatAdministrators; |
@@ -983,7 +982,10 @@ public void sendVoice() { |
983 | 982 | @Test |
984 | 983 | public void getWebhookInfo() { |
985 | 984 | GetWebhookInfoResponse response = bot.execute(new GetWebhookInfo()); |
986 | | - WebhookInfoTest.check(response.webhookInfo()); |
| 985 | + WebhookInfo webhookInfo = response.webhookInfo(); |
| 986 | + assertNotNull(webhookInfo.url()); |
| 987 | + assertFalse(webhookInfo.hasCustomCertificate()); |
| 988 | + assertTrue(webhookInfo.pendingUpdateCount() >= 0); |
987 | 989 | } |
988 | 990 |
|
989 | 991 | @Test |
@@ -1016,8 +1018,7 @@ public void setWebhook() throws IOException { |
1016 | 1018 | assertTrue(lastErrorMessage.contains("SSL")); |
1017 | 1019 | } |
1018 | 1020 | assertEquals(ipAddress, webhookInfo.ipAddress()); |
1019 | | - assertEquals(0, webhookInfo.pendingUpdateCount().intValue()); |
1020 | | - |
| 1021 | + assertTrue(webhookInfo.pendingUpdateCount() >= 0); |
1021 | 1022 |
|
1022 | 1023 | response = bot.execute(new SetWebhook().url("https://google.com") |
1023 | 1024 | .certificate(Files.readAllBytes(new File(certificateFile).toPath())).allowedUpdates("")); |
|
0 commit comments