diff --git a/telegrambots-extensions/src/test/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistryTest.java b/telegrambots-extensions/src/test/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistryTest.java index 2c22473c..9b847418 100644 --- a/telegrambots-extensions/src/test/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistryTest.java +++ b/telegrambots-extensions/src/test/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistryTest.java @@ -10,10 +10,10 @@ class CommandRegistryTest { @Test void should_create_registry() { - CommandRegistry registry = new CommandRegistry(true, "BotUsername"); + CommandRegistry registry = new CommandRegistry(true, () -> "BotUsername"); Assertions.assertNotNull(registry, "CommandRegistry is not created"); NullPointerException exception = Assertions.assertThrows(NullPointerException.class, - () -> new CommandRegistry(true, (String) null)); + () -> new CommandRegistry(true, () -> "BotUsername")); Assertions.assertEquals("Bot username must not be null", exception.getMessage(), "Invalid exception message"); }