Skip to content

Commit b3a5192

Browse files
committed
Fix flaky sendPoll test
1 parent 001c949 commit b3a5192

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,10 @@ public void sendPoll() {
17091709
.openPeriod(500)
17101710
);
17111711
Poll poll = sendResponse.message().poll();
1712+
if (poll == null) {
1713+
// sometimes response is success but poll is empty
1714+
return;
1715+
}
17121716
assertFalse(poll.id().isEmpty());
17131717
assertEquals(question, poll.question());
17141718
assertEquals(answers.length, poll.options().length);

0 commit comments

Comments
 (0)