Make AuthMe.management private; create test for CaptchaCommand

This commit is contained in:
ljacqu
2015-12-02 22:13:43 +01:00
parent f698c9241b
commit 1ca6bcffe1
9 changed files with 86 additions and 13 deletions
@@ -34,7 +34,7 @@ public class ForceLoginCommand extends ExecutableCommand {
sender.sendMessage("You cannot force login for the player " + playerName + "!");
return true;
}
plugin.management.performLogin(player, "dontneed", true);
plugin.getManagement().performLogin(player, "dontneed", true);
sender.sendMessage("Force Login for " + playerName + " performed!");
} catch (Exception e) {
sender.sendMessage("An error occurred while trying to get that player!");
@@ -8,6 +8,7 @@ import fr.xephi.authme.security.RandomString;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.output.Messages;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.util.Wrapper;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -30,10 +31,11 @@ public class CaptchaCommand extends ExecutableCommand {
String captcha = commandArguments.get(0);
// AuthMe plugin instance
final AuthMe plugin = AuthMe.getInstance();
final Wrapper wrapper = Wrapper.getInstance();
final AuthMe plugin = wrapper.getAuthMe();
// Messages instance
final Messages m = plugin.getMessages();
final Messages m = wrapper.getMessages();
// Command logic
if (PlayerCache.getInstance().isAuthenticated(playerNameLowerCase)) {
@@ -49,7 +49,7 @@ public class UnregisterCommand extends ExecutableCommand {
}
// Unregister the player
plugin.management.performUnregister(player, playerPass, false);
plugin.getManagement().performUnregister(player, playerPass, false);
return true;
}
}