#293 Translatable help messages: basic structure
(work in progress) - Create service that provides localized messages when available for HelpProvider
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package fr.xephi.authme.command.help;
|
||||
|
||||
import ch.jalu.injector.testing.BeforeInjecting;
|
||||
import ch.jalu.injector.testing.DelayedInjectionRunner;
|
||||
import ch.jalu.injector.testing.InjectDelayed;
|
||||
import fr.xephi.authme.command.CommandDescription;
|
||||
import fr.xephi.authme.command.FoundCommandResult;
|
||||
import fr.xephi.authme.command.FoundResultStatus;
|
||||
@@ -10,10 +13,12 @@ import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mock;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -41,12 +46,21 @@ import static org.mockito.Mockito.verify;
|
||||
/**
|
||||
* Test for {@link HelpProvider}.
|
||||
*/
|
||||
@RunWith(DelayedInjectionRunner.class)
|
||||
public class HelpProviderTest {
|
||||
|
||||
private static final String HELP_HEADER = "Help";
|
||||
private static Set<CommandDescription> commands;
|
||||
|
||||
@InjectDelayed
|
||||
private HelpProvider helpProvider;
|
||||
@Mock
|
||||
private PermissionsManager permissionsManager;
|
||||
@Mock
|
||||
private HelpMessagesService helpMessagesService;
|
||||
@Mock
|
||||
private Settings settings;
|
||||
@Mock
|
||||
private CommandSender sender;
|
||||
|
||||
@BeforeClass
|
||||
@@ -54,16 +68,13 @@ public class HelpProviderTest {
|
||||
commands = TestCommandsUtil.generateCommands();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUpHelpProvider() {
|
||||
permissionsManager = mock(PermissionsManager.class);
|
||||
Settings settings = mock(Settings.class);
|
||||
@BeforeInjecting
|
||||
public void setInitialSettings() {
|
||||
given(settings.getProperty(PluginSettings.HELP_HEADER)).willReturn(HELP_HEADER);
|
||||
helpProvider = new HelpProvider(permissionsManager, settings);
|
||||
sender = mock(CommandSender.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // FIXME: Fix test
|
||||
public void shouldShowLongDescription() {
|
||||
// given
|
||||
CommandDescription command = getCommandWithLabel(commands, "authme", "login");
|
||||
|
||||
Reference in New Issue
Block a user