From 77f703926d54c5ef03f7e88ea548ffd91637231c Mon Sep 17 00:00:00 2001 From: Stas Parshin <2172170+pengrad@users.noreply.github.com> Date: Sat, 2 Nov 2024 20:00:22 +0700 Subject: [PATCH] Fix tests --- .../test/java/com/pengrad/telegrambot/TelegramBotTest.java | 6 ++++++ .../java/com/pengrad/telegrambot/checks/MessageTest.java | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java b/library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java index 91462b9f..fd7e8d9d 100644 --- a/library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java +++ b/library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java @@ -647,6 +647,12 @@ public void sendMessageToChannel() { MessageTest.checkTextMessage(message); assertEquals(url, message.entities()[0].url()); assertEquals(channelId, message.senderChat().id()); + LinkPreviewOptions linkPreviewOptions = message.linkPreviewOptions(); + assertTrue(linkPreviewOptions.isDisabled()); + assertNull(linkPreviewOptions.url()); + assertNull(linkPreviewOptions.preferSmallMedia()); + assertNull(linkPreviewOptions.preferLargeMedia()); + assertNull(linkPreviewOptions.showAboveText()); } @Test diff --git a/library/src/test/java/com/pengrad/telegrambot/checks/MessageTest.java b/library/src/test/java/com/pengrad/telegrambot/checks/MessageTest.java index a875e5b8..55d99a88 100644 --- a/library/src/test/java/com/pengrad/telegrambot/checks/MessageTest.java +++ b/library/src/test/java/com/pengrad/telegrambot/checks/MessageTest.java @@ -46,7 +46,6 @@ public static void checkTextMessage(Message message) { assertFalse(message.isFromOffline()); assertFalse(message.hasMediaSpoiler()); assertNull(message.showCaptionAboveMedia()); - assertNull(message.linkPreviewOptions()); assertNull(message.effectId()); assertNull(message.messageAutoDeleteTimerChanged()); assertNull(message.refundedPayment());