Add ability to override TelegramUrl using SpringBoot starter #1482
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for custom Telegram URLs in the
telegrambots-springboot-longpolling-startermodule. The most important changes include modifications to theTelegramBotInitializerandTelegramBotStarterConfigurationclasses, as well as updates to the test configurations to accommodate the new functionality.Reason
The ability to override the default TelegramUrl is essential for developers who need to work with dedicate test environments.
Support for Custom Telegram URLs:
telegrambots-springboot-longpolling-starter/src/main/java/org/telegram/telegrambots/longpolling/starter/TelegramBotInitializer.java: Added a new constructor to accept aTelegramUrlparameter and updated theafterPropertiesSetmethod to use the custom URL. [1] [2]telegrambots-springboot-longpolling-starter/src/main/java/org/telegram/telegrambots/longpolling/starter/TelegramBotStarterConfiguration.java: Modified thetelegramBotInitializerbean to include theTelegramUrlparameter. [1] [2]Test Updates:
telegrambots-springboot-longpolling-starter/src/test/java/org/telegram/telegrambots/longpolling/starter/TestTelegramBotStarterConfiguration.java: Added assertions to check for the presence ofTelegramUrland updated method calls to include the new parameter. [1] [2] [3]telegrambots-springboot-longpolling-starter/src/test/java/org/telegram/telegrambots/longpolling/starter/TestTelegramBotStarterRegistrationHooks.java: Updated mock expectations to include theTelegramUrlparameter. [1] [2]telegrambots-springboot-longpolling-starter/src/test/java/org/telegram/telegrambots/longpolling/starter/TestTelegramBotStarterWithCustomTelegramUrlConfiguration.java: Added a new test class to verify the behavior with custom Telegram URLs.