Merge pull request #1393 from AuthMe/bungee-messaging-integration
Implement bungee messaging, CacheDataSource sync across network
This commit is contained in:
+3
@@ -3,6 +3,7 @@ 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 org.bukkit.command.CommandSender;
|
||||
import org.junit.Test;
|
||||
@@ -35,6 +36,8 @@ public class PurgeLastPositionCommandTest {
|
||||
@Mock
|
||||
private CommonService service;
|
||||
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
|
||||
@Test
|
||||
public void shouldPurgeLastPosOfUser() {
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public abstract class AbstractSqlDataSourceResourceClosingTest extends AbstractR
|
||||
private static List<Method> getDataSourceMethods() {
|
||||
List<Method> publicMethods = new ArrayList<>();
|
||||
for (Method method : DataSource.class.getDeclaredMethods()) {
|
||||
if (!IGNORED_METHODS.contains(method.getName())) {
|
||||
if (!IGNORED_METHODS.contains(method.getName()) && !method.isSynthetic()) {
|
||||
publicMethods.add(method);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,12 +117,9 @@ public final class ListenerConsistencyTest {
|
||||
}
|
||||
|
||||
private static boolean isTestableMethod(Method method) {
|
||||
// Exclude any methods with "$" in it: jacoco creates a "$jacocoInit" method we want to ignore, and
|
||||
// methods like "access$000" are created by the compiler when a private member is being accessed by an inner
|
||||
// class, which is not of interest for us
|
||||
// Also exclude getters
|
||||
// Exclude getters and synthetic methods
|
||||
String methodName = method.getName();
|
||||
if (Modifier.isPrivate(method.getModifiers()) || methodName.contains("$") || methodName.startsWith("get") || methodName.startsWith("is")) {
|
||||
if (Modifier.isPrivate(method.getModifiers()) || method.isSynthetic() || methodName.startsWith("get") || methodName.startsWith("is")) {
|
||||
return false;
|
||||
}
|
||||
// Skip reload() method (implementation of Reloadable interface)
|
||||
|
||||
@@ -6,6 +6,7 @@ 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 org.bukkit.command.CommandSender;
|
||||
import org.junit.Before;
|
||||
@@ -37,6 +38,8 @@ public class AsyncChangePasswordTest {
|
||||
private PlayerCache playerCache;
|
||||
@Mock
|
||||
private PasswordSecurity passwordSecurity;
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
|
||||
@Before
|
||||
public void setUpLogger() {
|
||||
|
||||
@@ -5,6 +5,7 @@ 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 org.bukkit.entity.Player;
|
||||
@@ -45,6 +46,9 @@ public class AsyncAddEmailTest {
|
||||
@Mock
|
||||
private ValidationService validationService;
|
||||
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
|
||||
@BeforeClass
|
||||
public static void setUp() {
|
||||
TestHelper.setupLogger();
|
||||
|
||||
@@ -4,6 +4,7 @@ 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 org.bukkit.entity.Player;
|
||||
@@ -44,6 +45,9 @@ public class AsyncChangeEmailTest {
|
||||
@Mock
|
||||
private ValidationService validationService;
|
||||
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
|
||||
@Test
|
||||
public void shouldChangeEmail() {
|
||||
// given
|
||||
|
||||
@@ -10,6 +10,7 @@ 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.settings.commandconfig.CommandManager;
|
||||
@@ -61,6 +62,8 @@ public class AsynchronousUnregisterTest {
|
||||
private TeleportationService teleportationService;
|
||||
@Mock
|
||||
private CommandManager commandManager;
|
||||
@Mock
|
||||
private BungeeService bungeeService;
|
||||
|
||||
@BeforeClass
|
||||
public static void initLogger() {
|
||||
|
||||
Reference in New Issue
Block a user