Add test for LoginCommand; create AuthMe mock test util

Had to create a getter for the Management instance in the AuthMe class for mocking, but fields should generally not be accessed globally. Hopefully soon we will be able to make the field private.
(cherry picked from commit f1a0022)
This commit is contained in:
ljacqu
2015-11-21 09:49:39 +01:00
parent 3934d67330
commit 987e38c5df
4 changed files with 113 additions and 1 deletions
@@ -1028,4 +1028,9 @@ public class AuthMe extends JavaPlugin {
public static int getVersionCode() {
return PLUGIN_VERSION_CODE;
}
/** Returns the management instance. */
public Management getManagement() {
return management;
}
}
@@ -24,7 +24,7 @@ public class LoginCommand extends ExecutableCommand {
final String playerPass = commandArguments.get(0);
// Log the player in
plugin.management.performLogin(player, playerPass, false);
plugin.getManagement().performLogin(player, playerPass, false);
return true;
}
}