#1146 List available converter, reference converters Wiki page in config.yml

This commit is contained in:
ljacqu
2017-05-21 12:28:35 +02:00
parent 5afe6bb35b
commit 1c46c92b4e
5 changed files with 58 additions and 22 deletions
@@ -42,7 +42,7 @@ public class ConverterCommandTest {
private ConverterCommand command;
@Mock
private CommonService commandService;
private CommonService commonService;
@Mock
private BukkitService bukkitService;
@@ -64,10 +64,23 @@ public class ConverterCommandTest {
command.executeCommand(sender, Collections.singletonList("invalid"));
// then
verify(sender).sendMessage(argThat(containsString("Converter does not exist")));
verifyNoMoreInteractions(commandService);
verifyZeroInteractions(converterFactory);
verifyZeroInteractions(bukkitService);
String converters = String.join(", ", ConverterCommand.CONVERTERS.keySet());
verify(sender).sendMessage(argThat(containsString(converters)));
verifyZeroInteractions(commonService, converterFactory, bukkitService);
}
@Test
public void shouldHandleCommandWithNoArgs() {
// given
CommandSender sender = mock(CommandSender.class);
// when
command.executeCommand(sender, Collections.emptyList());
// then
String converters = String.join(", ", ConverterCommand.CONVERTERS.keySet());
verify(sender).sendMessage(argThat(containsString(converters)));
verifyZeroInteractions(commonService, converterFactory, bukkitService);
}
@Test
@@ -122,7 +135,7 @@ public class ConverterCommandTest {
verifyNoMoreInteractions(converter);
verify(converterFactory).newInstance(converterClass);
verifyNoMoreInteractions(converterFactory);
verify(commandService).send(sender, MessageKey.ERROR);
verify(commonService).send(sender, MessageKey.ERROR);
}
private <T extends Converter> T createMockReturnedByInjector(Class<T> clazz) {