From 9c240fbf546f9209f896976a977b5a1e9fed70af Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sat, 11 Aug 2018 14:39:12 +0200 Subject: [PATCH] Fixed tests in DefaultHelpCommandTest --- .../api/commands/DefaultHelpCommandTest.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/test/java/world/bentobox/bentobox/api/commands/DefaultHelpCommandTest.java b/src/test/java/world/bentobox/bentobox/api/commands/DefaultHelpCommandTest.java index 4ef2d6849..38521c1fd 100644 --- a/src/test/java/world/bentobox/bentobox/api/commands/DefaultHelpCommandTest.java +++ b/src/test/java/world/bentobox/bentobox/api/commands/DefaultHelpCommandTest.java @@ -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]", @@ -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 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]",