Send more precise message when converter type does not exist

This commit is contained in:
ljacqu 2016-09-04 14:46:28 +02:00
parent ee5ed13931
commit 5930f705f2
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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);