Skip to content

Commit

Permalink
Fixed tests in DefaultHelpCommandTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Poslovitch committed Aug 11, 2018
1 parent d585703 commit 9c240fb
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,13 @@ public void testExecuteUserListOfString() {
when(parent.getDescription()).thenReturn("description");
when(parent.getPermission()).thenReturn("permission");
when(parent.getWorld()).thenReturn(mock(World.class));
when(user.getTranslationOrNothing("island")).thenReturn("island");
when(user.getTranslationOrNothing("parameters")).thenReturn("");
when(user.getTranslationOrNothing("description")).thenReturn("the main island command");
when(user.getTranslation("description")).thenReturn("the main island command");
DefaultHelpCommand dhc = new DefaultHelpCommand(parent);
dhc.execute(user, dhc.getLabel(), new ArrayList<>());
Mockito.verify(user).sendMessage("commands.help.header", "[label]", "BSkyBlock");
Mockito.verify(user).getTranslationOrNothing("island");
Mockito.verify(user).getTranslationOrNothing("parameters");
Mockito.verify(user).getTranslationOrNothing("description");
Mockito.verify(user).getTranslation("description");
Mockito.verify(user).sendMessage(
"commands.help.syntax",
"[usage]",
Expand All @@ -162,17 +160,15 @@ public void testExecuteSecondLevelHelp() {
when(parent.getParameters()).thenReturn("parameters");
when(parent.getDescription()).thenReturn("description");
when(parent.getPermission()).thenReturn("permission");
when(user.getTranslationOrNothing("island")).thenReturn("island");
when(user.getTranslationOrNothing("parameters")).thenReturn("");
when(user.getTranslationOrNothing("description")).thenReturn("the main island command");
when(user.getTranslation("description")).thenReturn("the main island command");
DefaultHelpCommand dhc = new DefaultHelpCommand(parent);
List<String> args = new ArrayList<>();
args.add("1");
dhc.execute(user, dhc.getLabel(), args);
// There are no header or footer shown
Mockito.verify(user).getTranslationOrNothing("island");
Mockito.verify(user).getTranslationOrNothing("parameters");
Mockito.verify(user).getTranslationOrNothing("description");
Mockito.verify(user).getTranslation("description");
Mockito.verify(user).sendMessage(
"commands.help.syntax",
"[usage]",
Expand Down

0 comments on commit 9c240fb

Please sign in to comment.