Add missing unit tests for commands
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.command.ExecutableCommand;
|
||||
import fr.xephi.authme.converter.Converter;
|
||||
@@ -58,7 +59,8 @@ public class ConverterCommand implements ExecutableCommand {
|
||||
sender.sendMessage("[AuthMe] Successfully converted from " + jobType.getName());
|
||||
}
|
||||
|
||||
private enum ConvertType {
|
||||
@VisibleForTesting
|
||||
enum ConvertType {
|
||||
XAUTH("xauth", xAuthConverter.class),
|
||||
CRAZYLOGIN("crazylogin", CrazyLoginConverter.class),
|
||||
RAKAMAK("rakamak", RakamakConverter.class),
|
||||
|
||||
@@ -18,13 +18,16 @@ public class UnregisterCommand extends PlayerCommand {
|
||||
@Inject
|
||||
private CommandService commandService;
|
||||
|
||||
@Inject
|
||||
private PlayerCache playerCache;
|
||||
|
||||
@Override
|
||||
public void runCommand(Player player, List<String> arguments) {
|
||||
String playerPass = arguments.get(0);
|
||||
final String playerNameLowerCase = player.getName().toLowerCase();
|
||||
|
||||
// Make sure the player is authenticated
|
||||
if (!PlayerCache.getInstance().isAuthenticated(playerNameLowerCase)) {
|
||||
if (!playerCache.isAuthenticated(playerNameLowerCase)) {
|
||||
commandService.send(player, MessageKey.NOT_LOGGED_IN);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user