Fixed tests

They were broken as of 8a16940e14
This commit is contained in:
Florian CUNY 2018-12-15 10:30:17 +01:00
parent b6e8c19a86
commit 7dd06b9d9b
2 changed files with 4 additions and 8 deletions

View File

@ -94,7 +94,7 @@ public class DefaultHelpCommand extends CompositeCommand {
if (user.isPlayer()) { if (user.isPlayer()) {
// Player. Check perms // Player. Check perms
if (user.isOp() || user.hasPermission(parent.getPermission())) { if (user.isOp() || user.hasPermission(parent.getPermission())) {
if (params.isEmpty()) { if (params == null || params.isEmpty()) {
user.sendMessage(HELP_SYNTAX_NO_PARAMETERS_REF, USAGE_PLACEHOLDER, usage, DESC_PLACEHOLDER, desc); user.sendMessage(HELP_SYNTAX_NO_PARAMETERS_REF, USAGE_PLACEHOLDER, usage, DESC_PLACEHOLDER, desc);
} else { } else {
user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc); user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc);
@ -105,7 +105,7 @@ public class DefaultHelpCommand extends CompositeCommand {
} }
} else if (!parent.isOnlyPlayer()) { } else if (!parent.isOnlyPlayer()) {
// Console. Only show if it is a console command // Console. Only show if it is a console command
if (params.isEmpty()) { if (params == null || params.isEmpty()) {
user.sendMessage(HELP_SYNTAX_NO_PARAMETERS_REF, USAGE_PLACEHOLDER, usage, DESC_PLACEHOLDER, desc); user.sendMessage(HELP_SYNTAX_NO_PARAMETERS_REF, USAGE_PLACEHOLDER, usage, DESC_PLACEHOLDER, desc);
} else { } else {
user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc); user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc);

View File

@ -140,11 +140,9 @@ public class DefaultHelpCommandTest {
Mockito.verify(user).getTranslationOrNothing("parameters"); Mockito.verify(user).getTranslationOrNothing("parameters");
Mockito.verify(user).getTranslation("description"); Mockito.verify(user).getTranslation("description");
Mockito.verify(user).sendMessage( Mockito.verify(user).sendMessage(
"commands.help.syntax", "commands.help.syntax-no-parameters",
"[usage]", "[usage]",
"island", "island",
"[parameters]",
"",
"[description]", "[description]",
"the main island command" "the main island command"
); );
@ -169,11 +167,9 @@ public class DefaultHelpCommandTest {
Mockito.verify(user).getTranslationOrNothing("parameters"); Mockito.verify(user).getTranslationOrNothing("parameters");
Mockito.verify(user).getTranslation("description"); Mockito.verify(user).getTranslation("description");
Mockito.verify(user).sendMessage( Mockito.verify(user).sendMessage(
"commands.help.syntax", "commands.help.syntax-no-parameters",
"[usage]", "[usage]",
"island", "island",
"[parameters]",
"",
"[description]", "[description]",
"the main island command" "the main island command"
); );