Skip to content

Commit 9d9a10c

Browse files
committed
Fix sendVideoNote test
1 parent bffe4ba commit 9d9a10c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,16 @@ public void sendChatAction() {
298298

299299
@Test
300300
public void sendVideoNote() {
301-
SendResponse response = bot.execute(new SendVideoNote(chatId, "DQADAgADmQADYgwpSbum1JrxPsbmAg").length(240));
301+
SendResponse response = bot.execute(new SendVideoNote(chatId, "DQADAgADmQADYgwpSbum1JrxPsbmAg"));
302302
VideoNoteCheck.check(response.message().videoNote());
303303
}
304304

305+
@Test
306+
public void sendVideoNoteFile() {
307+
SendResponse response = bot.execute(new SendVideoNote(chatId, new File(videoFile)).length(20).duration(30));
308+
VideoNoteCheck.check(response.message().videoNote(), true);
309+
}
310+
305311
@Test
306312
public void sendInvoice() {
307313
SendResponse response = bot.execute(new SendInvoice(chatId, "title", "desc", "my_payload",

library/src/test/java/com/pengrad/telegrambot/VideoNoteCheck.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
public class VideoNoteCheck {
1212

1313
public static void check(VideoNote videoNote) {
14+
check(videoNote, false);
15+
}
16+
17+
public static void check(VideoNote videoNote, boolean full) {
1418
assertNotNull(videoNote.fileId());
1519
assertNotNull(videoNote.length());
1620
assertNotNull(videoNote.duration());
17-
assertNotNull(videoNote.fileSize());
1821
PhotoSizeTest.checkPhotos(videoNote.thumb());
22+
if (full) {
23+
assertNotNull(videoNote.fileSize());
24+
}
1925
}
2026

2127
}

0 commit comments

Comments
 (0)