#830 Write tests for registration process

This commit is contained in:
ljacqu
2016-12-18 13:11:56 +01:00
parent 398fa4d38d
commit 370d203873
7 changed files with 504 additions and 4 deletions
@@ -20,7 +20,9 @@ import javax.inject.Inject;
import static fr.xephi.authme.process.register.executors.PlayerAuthBuilderHelper.createPlayerAuth;
/**
* Provides registration executors for password-based registration variants.
*/
class PasswordRegisterExecutorProvider {
/**
@@ -10,6 +10,9 @@ import org.bukkit.entity.Player;
*/
final class PlayerAuthBuilderHelper {
private PlayerAuthBuilderHelper() {
}
static PlayerAuth createPlayerAuth(Player player, HashedPassword hashedPassword, String email) {
return PlayerAuth.builder()
.name(player.getName().toLowerCase())
@@ -20,7 +23,4 @@ final class PlayerAuthBuilderHelper {
.location(player.getLocation())
.build();
}
}
@@ -10,6 +10,9 @@ public interface RegistrationExecutor {
/**
* Returns whether the registration may take place. Use this method to execute
* checks specific to the registration method.
* <p>
* If this method returns {@code false}, it is expected that the executor inform
* the player about the error within this method call.
*
* @return true if registration may be performed, false otherwise
*/