diff --git a/src/main/java/fr/xephi/authme/command/executable/authme/ConverterCommand.java b/src/main/java/fr/xephi/authme/command/executable/authme/ConverterCommand.java index 64cf5d196..a615f3ec9 100644 --- a/src/main/java/fr/xephi/authme/command/executable/authme/ConverterCommand.java +++ b/src/main/java/fr/xephi/authme/command/executable/authme/ConverterCommand.java @@ -47,7 +47,7 @@ public class ConverterCommand implements ExecutableCommand { // Determine the job type Class converterClass = CONVERTERS.get(job.toLowerCase()); if (converterClass == null) { - commandService.send(sender, MessageKey.ERROR); + sender.sendMessage("[AuthMe] Converter does not exist!"); return; } diff --git a/src/test/java/fr/xephi/authme/command/executable/authme/ConverterCommandTest.java b/src/test/java/fr/xephi/authme/command/executable/authme/ConverterCommandTest.java index a547929bf..d69e238d9 100644 --- a/src/test/java/fr/xephi/authme/command/executable/authme/ConverterCommandTest.java +++ b/src/test/java/fr/xephi/authme/command/executable/authme/ConverterCommandTest.java @@ -22,10 +22,12 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; import static org.mockito.BDDMockito.given; import static org.mockito.Matchers.any; +import static org.mockito.Matchers.argThat; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -64,7 +66,7 @@ public class ConverterCommandTest { command.executeCommand(sender, Collections.singletonList("invalid")); // then - verify(commandService).send(sender, MessageKey.ERROR); + verify(sender).sendMessage(argThat(containsString("Converter does not exist"))); verifyNoMoreInteractions(commandService); verifyZeroInteractions(injector); verifyZeroInteractions(bukkitService);