Skip to content

Commit e4f8158

Browse files
committed
Add max_connections in SetWebhook
1 parent c278c04 commit e4f8158

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/main/java/com/pengrad/telegrambot/request/SetWebhook.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public SetWebhook certificate(File certificate) {
3030
return add("certificate", certificate);
3131
}
3232

33+
public SetWebhook maxConnections(int maxConnections) {
34+
return add("max_connections", maxConnections);
35+
}
36+
3337
@Override
3438
public boolean isMultipart() {
3539
return isMultipart;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import java.util.List;
1515
import java.util.Properties;
1616

17+
import static org.junit.Assert.assertTrue;
18+
1719
/**
1820
* stas
1921
* 5/2/16.
@@ -231,6 +233,12 @@ public void getWebhookInfo() {
231233
WebhookInfoTest.check(response.webhookInfo());
232234
}
233235

236+
@Test
237+
public void setWebhook() {
238+
BaseResponse response = bot.execute(new SetWebhook().url("https://google.com").maxConnections(100));
239+
assertTrue(response.isOk());
240+
}
241+
234242
@Test
235243
public void sendGame() {
236244
SendResponse response = bot.execute(new SendGame(chatId, "pengrad_test_game"));

0 commit comments

Comments
 (0)