Implement AuthMeBungee autologin (#1402)
* Implement AuthMeBungee autologin There is a failing test due to cyclic dependency injection, @ljacqu could you take a quick look at this? * Try to fix recursive dependency injection * Fix codestyle * Fix the subchannel name, again... * Split BungeeService into BungeeSender and BungeeReceiver
This commit is contained in:
@@ -16,6 +16,8 @@ import fr.xephi.authme.process.Management;
|
||||
import fr.xephi.authme.process.login.ProcessSyncPlayerLogin;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeReceiver;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeSender;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.purge.PurgeService;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -112,10 +114,12 @@ public class AuthMeInitializationTest {
|
||||
|
||||
// then
|
||||
// Take a few samples and ensure that they are not null
|
||||
assertThat(injector.getIfAvailable(AuthMeApi.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(BlockListener.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(BungeeReceiver.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(BungeeSender.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(CommandHandler.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(Management.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(AuthMeApi.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(PasswordSecurity.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(PermissionsManager.class), not(nullValue()));
|
||||
assertThat(injector.getIfAvailable(ProcessSyncPlayerLogin.class), not(nullValue()));
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ package fr.xephi.authme.command.executable.authme;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -37,7 +37,7 @@ public class PurgeLastPositionCommandTest {
|
||||
private CommonService service;
|
||||
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
private BungeeSender bungeeSender;
|
||||
|
||||
@Test
|
||||
public void shouldPurgeLastPosOfUser() {
|
||||
|
||||
@@ -6,8 +6,8 @@ import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -39,7 +39,7 @@ public class AsyncChangePasswordTest {
|
||||
@Mock
|
||||
private PasswordSecurity passwordSecurity;
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
private BungeeSender bungeeSender;
|
||||
|
||||
@Before
|
||||
public void setUpLogger() {
|
||||
|
||||
@@ -5,9 +5,9 @@ import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.service.ValidationService;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@@ -47,7 +47,7 @@ public class AsyncAddEmailTest {
|
||||
private ValidationService validationService;
|
||||
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
private BungeeSender bungeeSender;
|
||||
|
||||
@BeforeClass
|
||||
public static void setUp() {
|
||||
|
||||
@@ -4,9 +4,9 @@ import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.service.ValidationService;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -46,7 +46,7 @@ public class AsyncChangeEmailTest {
|
||||
private ValidationService validationService;
|
||||
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
private BungeeSender bungeeSender;
|
||||
|
||||
@Test
|
||||
public void shouldChangeEmail() {
|
||||
|
||||
@@ -10,9 +10,9 @@ import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.service.TeleportationService;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeSender;
|
||||
import fr.xephi.authme.settings.commandconfig.CommandManager;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -63,7 +63,7 @@ public class AsynchronousUnregisterTest {
|
||||
@Mock
|
||||
private CommandManager commandManager;
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
private BungeeSender bungeeSender;
|
||||
|
||||
@BeforeClass
|
||||
public static void initLogger() {
|
||||
|
||||
Reference in New Issue
Block a user