#306 Create tests for CommandService and PlayerCommand

This commit is contained in:
ljacqu
2015-12-26 20:58:05 +01:00
parent 27fee3ca64
commit 47e97244a7
5 changed files with 277 additions and 7 deletions
@@ -7,6 +7,7 @@ import fr.xephi.authme.command.PlayerCommand;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.security.RandomString;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.util.Wrapper;
import org.bukkit.entity.Player;
import java.util.List;
@@ -17,10 +18,12 @@ public class CaptchaCommand extends PlayerCommand {
public void runCommand(Player player, List<String> arguments, CommandService commandService) {
final String playerNameLowerCase = player.getName().toLowerCase();
final String captcha = arguments.get(0);
final AuthMe plugin = AuthMe.getInstance();
Wrapper wrapper = Wrapper.getInstance();
final AuthMe plugin = wrapper.getAuthMe();
PlayerCache playerCache = wrapper.getPlayerCache();
// Command logic
if (PlayerCache.getInstance().isAuthenticated(playerNameLowerCase)) {
if (playerCache.isAuthenticated(playerNameLowerCase)) {
commandService.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
return;
}