diff --git a/cloud-core/src/main/java/cloud/commandframework/CommandBean.java b/cloud-core/src/main/java/cloud/commandframework/CommandBean.java index 30df141ab..f7b65021d 100644 --- a/cloud-core/src/main/java/cloud/commandframework/CommandBean.java +++ b/cloud-core/src/main/java/cloud/commandframework/CommandBean.java @@ -95,7 +95,7 @@ protected CommandBean() { * @param builder the command builder * @return the updated builder */ - protected abstract Command.@NonNull Builder configure(Command.@NonNull Builder builder); + protected abstract Command.@NonNull Builder configure(Command.@NonNull Builder builder); /** * Default command handler for this command bean. Does nothing unless override. diff --git a/cloud-core/src/test/java/cloud/commandframework/CommandBeanTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandBeanTest.java index 2d9aadab2..3d970147a 100644 --- a/cloud-core/src/test/java/cloud/commandframework/CommandBeanTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandBeanTest.java @@ -67,7 +67,8 @@ void testCommandBeanRegistration() { assertThat(command.commandExecutionHandler()).isEqualTo(testCommandBean); } - public static class TestCommandBean extends CommandBean { + + public static final class TestCommandBean extends CommandBean { @Override protected @NonNull CommandProperties properties() { @@ -80,8 +81,16 @@ public static class TestCommandBean extends CommandBean { } @Override - protected Command.@NonNull Builder configure(final Command.@NonNull Builder builder) { - return builder.required("argument", IntegerParser.integerParser()); + protected Command.@NonNull Builder configure( + final Command.@NonNull Builder builder + ) { + return builder.senderType(ChildTestCommandSender.class) + .required("argument", IntegerParser.integerParser()); } } + + + public static final class ChildTestCommandSender extends TestCommandSender { + + } }