You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/12/12 09:25:37 UTC

[camel] branch camel-3.18.x updated: Revert "CAMEL-18805: Telegram : Fix unregister webhook API method (#8862)"

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.18.x by this push:
     new 8af50f28611 Revert "CAMEL-18805: Telegram : Fix unregister webhook API method (#8862)"
8af50f28611 is described below

commit 8af50f28611eefb90e07e8e0e3f0b7543e94859b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Dec 12 10:25:23 2022 +0100

    Revert "CAMEL-18805: Telegram : Fix unregister webhook API method (#8862)"
    
    This reverts commit cc237b9290137677fa82018247b1e13b7d7cd575.
---
 .../telegram/service/TelegramServiceRestBotAPIAdapter.java         | 7 +------
 .../camel/component/telegram/TelegramWebhookRegistrationTest.java  | 5 -----
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
index a207af7f294..4a1934e1f3f 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
@@ -190,12 +190,7 @@ public class TelegramServiceRestBotAPIAdapter implements TelegramService {
 
     @Override
     public boolean removeWebhook() {
-        final String uri = baseUri + "/deleteWebhook";
-
-        final HttpRequest.Builder request = HttpRequest.newBuilder().uri(URI.create(uri)).GET();
-
-        WebhookResult res = sendSyncRequest(request.build(), WebhookResult.class);
-        return res.isOk() && res.isResult();
+        return setWebhook("");
     }
 
     @Override
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookRegistrationTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookRegistrationTest.java
index 876342dfe3e..9c4a2a5cbb7 100644
--- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookRegistrationTest.java
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookRegistrationTest.java
@@ -136,11 +136,6 @@ public class TelegramWebhookRegistrationTest extends TelegramTestSupport {
                         "setWebhook?url=http://my-domain.com/my-test",
                         "GET",
                         String.class,
-                        TelegramTestUtil.serialize(result))
-                .addEndpoint(
-                        "deleteWebhook",
-                        "GET",
-                        String.class,
                         TelegramTestUtil.serialize(result));
     }