mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-03 09:10:01 +01:00
Send more precise message when converter type does not exist
This commit is contained in:
parent
ee5ed13931
commit
5930f705f2
@ -47,7 +47,7 @@ public class ConverterCommand implements ExecutableCommand {
|
||||
// Determine the job type
|
||||
Class<? extends Converter> converterClass = CONVERTERS.get(job.toLowerCase());
|
||||
if (converterClass == null) {
|
||||
commandService.send(sender, MessageKey.ERROR);
|
||||
sender.sendMessage("[AuthMe] Converter does not exist!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user