Package cleanup
- authme.cache to authme.data - Rename PlayerData to LimboPlayer to match with LimboCache - Move authme.converter to authme.datasource.converter - Split output package into output and message
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package fr.xephi.authme;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Matcher;
|
||||
|
||||
@@ -2,8 +2,8 @@ package fr.xephi.authme.api;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ReflectionTestUtils;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.process.Management;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package fr.xephi.authme.command;
|
||||
|
||||
import com.github.authme.configme.properties.Property;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.service.ValidationService;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.junit.Test;
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
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;
|
||||
|
||||
@@ -3,8 +3,8 @@ package fr.xephi.authme.command.executable.authme;
|
||||
import ch.jalu.injector.Injector;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.converter.Converter;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.datasource.converter.Converter;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.limbo.LimboCache;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
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;
|
||||
|
||||
@@ -9,7 +9,7 @@ import fr.xephi.authme.datasource.DataSourceType;
|
||||
import fr.xephi.authme.initialization.Reloadable;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.output.LogLevel;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.junit.Test;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package fr.xephi.authme.command.executable.captcha;
|
||||
|
||||
import fr.xephi.authme.cache.CaptchaManager;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.CaptchaManager;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package fr.xephi.authme.command.executable.changepassword;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package fr.xephi.authme.command.executable.email;
|
||||
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package fr.xephi.authme.command.executable.email;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.mail.SendMailSSL;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.service.RecoveryCodeService;
|
||||
|
||||
@@ -3,7 +3,7 @@ package fr.xephi.authme.command.executable.register;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.mail.SendMailSSL;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.settings.properties.EmailSettings;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package fr.xephi.authme.command.executable.unregister;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.junit.Test;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme.cache;
|
||||
package fr.xephi.authme.data;
|
||||
|
||||
import fr.xephi.authme.ReflectionTestUtils;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme.cache;
|
||||
package fr.xephi.authme.data;
|
||||
|
||||
import fr.xephi.authme.ReflectionTestUtils;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
package fr.xephi.authme.cache;
|
||||
package fr.xephi.authme.data;
|
||||
|
||||
import fr.xephi.authme.ReflectionTestUtils;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.TempbanManager.TimedCounter;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.data.TempbanManager.TimedCounter;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
+15
-15
@@ -1,15 +1,15 @@
|
||||
package fr.xephi.authme.cache.backup;
|
||||
package fr.xephi.authme.data.backup;
|
||||
|
||||
import ch.jalu.injector.testing.BeforeInjecting;
|
||||
import ch.jalu.injector.testing.DelayedInjectionRunner;
|
||||
import ch.jalu.injector.testing.InjectDelayed;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.limbo.PlayerData;
|
||||
import fr.xephi.authme.data.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.initialization.DataFolder;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import fr.xephi.authme.util.FileUtils;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -32,16 +32,16 @@ import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
/**
|
||||
* Test for {@link PlayerDataStorage}.
|
||||
* Test for {@link LimboPlayerStorage}.
|
||||
*/
|
||||
@RunWith(DelayedInjectionRunner.class)
|
||||
public class PlayerDataStorageTest {
|
||||
public class LimboPlayerStorageTest {
|
||||
|
||||
private static final UUID SAMPLE_UUID = UUID.nameUUIDFromBytes("PlayerDataStorageTest".getBytes());
|
||||
private static final String SOURCE_FOLDER = TestHelper.PROJECT_ROOT + "cache/backup/";
|
||||
private static final String SOURCE_FOLDER = TestHelper.PROJECT_ROOT + "data/backup/";
|
||||
|
||||
@InjectDelayed
|
||||
private PlayerDataStorage playerDataStorage;
|
||||
private LimboPlayerStorage limboPlayerStorage;
|
||||
|
||||
@Mock
|
||||
private SpawnLoader spawnLoader;
|
||||
@@ -61,11 +61,11 @@ public class PlayerDataStorageTest {
|
||||
@BeforeInjecting
|
||||
public void copyTestFiles() throws IOException {
|
||||
dataFolder = temporaryFolder.newFolder();
|
||||
File playerFolder = new File(dataFolder, StringUtils.makePath("playerdata", SAMPLE_UUID.toString()));
|
||||
File playerFolder = new File(dataFolder, FileUtils.makePath("playerdata", SAMPLE_UUID.toString()));
|
||||
if (!playerFolder.mkdirs()) {
|
||||
throw new IllegalStateException("Cannot create '" + playerFolder.getAbsolutePath() + "'");
|
||||
}
|
||||
Files.copy(TestHelper.getJarPath(StringUtils.makePath(SOURCE_FOLDER, "sample-folder", "data.json")),
|
||||
Files.copy(TestHelper.getJarPath(FileUtils.makePath(SOURCE_FOLDER, "sample-folder", "data.json")),
|
||||
new File(playerFolder, "data.json").toPath());
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class PlayerDataStorageTest {
|
||||
given(bukkitService.getWorld("nether")).willReturn(world);
|
||||
|
||||
// when
|
||||
PlayerData data = playerDataStorage.readData(player);
|
||||
LimboPlayer data = limboPlayerStorage.readData(player);
|
||||
|
||||
// then
|
||||
assertThat(data, not(nullValue()));
|
||||
@@ -103,7 +103,7 @@ public class PlayerDataStorageTest {
|
||||
given(player.getUniqueId()).willReturn(UUID.nameUUIDFromBytes("other-player".getBytes()));
|
||||
|
||||
// when
|
||||
PlayerData data = playerDataStorage.readData(player);
|
||||
LimboPlayer data = limboPlayerStorage.readData(player);
|
||||
|
||||
// then
|
||||
assertThat(data, nullValue());
|
||||
@@ -118,8 +118,8 @@ public class PlayerDataStorageTest {
|
||||
given(player2.getUniqueId()).willReturn(UUID.nameUUIDFromBytes("not-stored".getBytes()));
|
||||
|
||||
// when / then
|
||||
assertThat(playerDataStorage.hasData(player1), equalTo(true));
|
||||
assertThat(playerDataStorage.hasData(player2), equalTo(false));
|
||||
assertThat(limboPlayerStorage.hasData(player1), equalTo(true));
|
||||
assertThat(limboPlayerStorage.hasData(player2), equalTo(false));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -140,10 +140,10 @@ public class PlayerDataStorageTest {
|
||||
given(spawnLoader.getPlayerLocationOrSpawn(player)).willReturn(location);
|
||||
|
||||
// when
|
||||
playerDataStorage.saveData(player);
|
||||
limboPlayerStorage.saveData(player);
|
||||
|
||||
// then
|
||||
File playerFile = new File(dataFolder, StringUtils.makePath("playerdata", uuid.toString(), "data.json"));
|
||||
File playerFile = new File(dataFolder, FileUtils.makePath("playerdata", uuid.toString(), "data.json"));
|
||||
assertThat(playerFile.exists(), equalTo(true));
|
||||
// TODO ljacqu 20160711: Check contents of file
|
||||
}
|
||||
+38
-38
@@ -1,7 +1,7 @@
|
||||
package fr.xephi.authme.cache.limbo;
|
||||
package fr.xephi.authme.data.limbo;
|
||||
|
||||
import fr.xephi.authme.ReflectionTestUtils;
|
||||
import fr.xephi.authme.cache.backup.PlayerDataStorage;
|
||||
import fr.xephi.authme.data.backup.LimboPlayerStorage;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
@@ -44,7 +44,7 @@ public class LimboCacheTest {
|
||||
private SpawnLoader spawnLoader;
|
||||
|
||||
@Mock
|
||||
private PlayerDataStorage playerDataStorage;
|
||||
private LimboPlayerStorage limboPlayerStorage;
|
||||
|
||||
@Test
|
||||
public void shouldAddPlayerData() {
|
||||
@@ -63,13 +63,13 @@ public class LimboCacheTest {
|
||||
given(permissionsManager.hasGroupSupport()).willReturn(true);
|
||||
String group = "test-group";
|
||||
given(permissionsManager.getPrimaryGroup(player)).willReturn(group);
|
||||
given(playerDataStorage.hasData(player)).willReturn(false);
|
||||
given(limboPlayerStorage.hasData(player)).willReturn(false);
|
||||
|
||||
// when
|
||||
limboCache.addPlayerData(player);
|
||||
|
||||
// then
|
||||
PlayerData limboPlayer = limboCache.getPlayerData(name);
|
||||
LimboPlayer limboPlayer = limboCache.getPlayerData(name);
|
||||
assertThat(limboPlayer.getLocation(), equalTo(location));
|
||||
assertThat(limboPlayer.isOperator(), equalTo(true));
|
||||
assertThat(limboPlayer.getWalkSpeed(), equalTo(walkSpeed));
|
||||
@@ -84,22 +84,22 @@ public class LimboCacheTest {
|
||||
String name = "player01";
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn(name);
|
||||
given(playerDataStorage.hasData(player)).willReturn(true);
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
given(playerDataStorage.readData(player)).willReturn(playerData);
|
||||
given(limboPlayerStorage.hasData(player)).willReturn(true);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
given(limboPlayerStorage.readData(player)).willReturn(limboPlayer);
|
||||
float walkSpeed = 2.4f;
|
||||
given(playerData.getWalkSpeed()).willReturn(walkSpeed);
|
||||
given(playerData.isCanFly()).willReturn(true);
|
||||
given(limboPlayer.getWalkSpeed()).willReturn(walkSpeed);
|
||||
given(limboPlayer.isCanFly()).willReturn(true);
|
||||
float flySpeed = 1.0f;
|
||||
given(playerData.getFlySpeed()).willReturn(flySpeed);
|
||||
given(limboPlayer.getFlySpeed()).willReturn(flySpeed);
|
||||
String group = "primary-group";
|
||||
given(playerData.getGroup()).willReturn(group);
|
||||
given(limboPlayer.getGroup()).willReturn(group);
|
||||
|
||||
// when
|
||||
limboCache.addPlayerData(player);
|
||||
|
||||
// then
|
||||
PlayerData result = limboCache.getPlayerData(name);
|
||||
LimboPlayer result = limboCache.getPlayerData(name);
|
||||
assertThat(result.getWalkSpeed(), equalTo(walkSpeed));
|
||||
assertThat(result.isCanFly(), equalTo(true));
|
||||
assertThat(result.getFlySpeed(), equalTo(flySpeed));
|
||||
@@ -112,16 +112,16 @@ public class LimboCacheTest {
|
||||
String name = "Champ";
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn(name);
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
given(playerData.isOperator()).willReturn(true);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
given(limboPlayer.isOperator()).willReturn(true);
|
||||
float walkSpeed = 2.4f;
|
||||
given(playerData.getWalkSpeed()).willReturn(walkSpeed);
|
||||
given(playerData.isCanFly()).willReturn(true);
|
||||
given(limboPlayer.getWalkSpeed()).willReturn(walkSpeed);
|
||||
given(limboPlayer.isCanFly()).willReturn(true);
|
||||
float flySpeed = 1.0f;
|
||||
given(playerData.getFlySpeed()).willReturn(flySpeed);
|
||||
given(limboPlayer.getFlySpeed()).willReturn(flySpeed);
|
||||
String group = "primary-group";
|
||||
given(playerData.getGroup()).willReturn(group);
|
||||
getCache().put(name.toLowerCase(), playerData);
|
||||
given(limboPlayer.getGroup()).willReturn(group);
|
||||
getCache().put(name.toLowerCase(), limboPlayer);
|
||||
given(settings.getProperty(PluginSettings.ENABLE_PERMISSION_CHECK)).willReturn(true);
|
||||
given(permissionsManager.hasGroupSupport()).willReturn(true);
|
||||
|
||||
@@ -134,7 +134,7 @@ public class LimboCacheTest {
|
||||
verify(player).setAllowFlight(true);
|
||||
verify(player).setFlySpeed(flySpeed);
|
||||
verify(permissionsManager).setGroup(player, group);
|
||||
verify(playerData).clearTasks();
|
||||
verify(limboPlayer).clearTasks();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -143,14 +143,14 @@ public class LimboCacheTest {
|
||||
String name = "Champ";
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn(name);
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
given(playerData.isOperator()).willReturn(true);
|
||||
given(playerData.getWalkSpeed()).willReturn(0f);
|
||||
given(playerData.isCanFly()).willReturn(true);
|
||||
given(playerData.getFlySpeed()).willReturn(0f);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
given(limboPlayer.isOperator()).willReturn(true);
|
||||
given(limboPlayer.getWalkSpeed()).willReturn(0f);
|
||||
given(limboPlayer.isCanFly()).willReturn(true);
|
||||
given(limboPlayer.getFlySpeed()).willReturn(0f);
|
||||
String group = "primary-group";
|
||||
given(playerData.getGroup()).willReturn(group);
|
||||
getCache().put(name.toLowerCase(), playerData);
|
||||
given(limboPlayer.getGroup()).willReturn(group);
|
||||
getCache().put(name.toLowerCase(), limboPlayer);
|
||||
given(settings.getProperty(PluginSettings.ENABLE_PERMISSION_CHECK)).willReturn(true);
|
||||
given(permissionsManager.hasGroupSupport()).willReturn(true);
|
||||
|
||||
@@ -180,9 +180,9 @@ public class LimboCacheTest {
|
||||
@Test
|
||||
public void shouldRemoveAndClearTasks() {
|
||||
// given
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
String name = "abcdef";
|
||||
getCache().put(name, playerData);
|
||||
getCache().put(name, limboPlayer);
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn(name);
|
||||
|
||||
@@ -191,16 +191,16 @@ public class LimboCacheTest {
|
||||
|
||||
// then
|
||||
assertThat(getCache(), anEmptyMap());
|
||||
verify(playerData).clearTasks();
|
||||
verify(limboPlayer).clearTasks();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldDeleteFromCacheAndStorage() {
|
||||
// given
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
String name = "SomeName";
|
||||
getCache().put(name.toLowerCase(), playerData);
|
||||
getCache().put("othername", mock(PlayerData.class));
|
||||
getCache().put(name.toLowerCase(), limboPlayer);
|
||||
getCache().put("othername", mock(LimboPlayer.class));
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn(name);
|
||||
|
||||
@@ -209,22 +209,22 @@ public class LimboCacheTest {
|
||||
|
||||
// then
|
||||
assertThat(getCache(), aMapWithSize(1));
|
||||
verify(playerData).clearTasks();
|
||||
verify(playerDataStorage).removeData(player);
|
||||
verify(limboPlayer).clearTasks();
|
||||
verify(limboPlayerStorage).removeData(player);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnIfHasData() {
|
||||
// given
|
||||
String name = "tester";
|
||||
getCache().put(name, mock(PlayerData.class));
|
||||
getCache().put(name, mock(LimboPlayer.class));
|
||||
|
||||
// when / then
|
||||
assertThat(limboCache.hasPlayerData(name), equalTo(true));
|
||||
assertThat(limboCache.hasPlayerData("someone_else"), equalTo(false));
|
||||
}
|
||||
|
||||
private Map<String, PlayerData> getCache() {
|
||||
private Map<String, LimboPlayer> getCache() {
|
||||
return ReflectionTestUtils.getFieldValue(LimboCache.class, limboCache, "cache");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.xephi.authme.datasource;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
@@ -2,7 +2,9 @@ package fr.xephi.authme.datasource;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.FlatFile;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@@ -23,7 +25,7 @@ import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* Integration test for the deprecated {@link FlatFile} datasource. The flatfile datasource is no longer used.
|
||||
* Essentially, the only time we use it is in {@link fr.xephi.authme.converter.ForceFlatToSqlite},
|
||||
* Essentially, the only time we use it is in {@link fr.xephi.authme.datasource.converter.ForceFlatToSqlite},
|
||||
* which requires {@link FlatFile#getAllAuths()}.
|
||||
*/
|
||||
public class FlatFileIntegrationTest {
|
||||
|
||||
@@ -4,6 +4,9 @@ import com.github.authme.configme.properties.Property;
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.datasource.AbstractDataSourceIntegrationTest;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.MySQL;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import org.junit.After;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package fr.xephi.authme.datasource;
|
||||
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import fr.xephi.authme.datasource.AbstractResourceClosingTest;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.MySQL;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@ package fr.xephi.authme.datasource;
|
||||
|
||||
import com.github.authme.configme.properties.Property;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.AbstractDataSourceIntegrationTest;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.SQLite;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import org.junit.After;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package fr.xephi.authme.datasource;
|
||||
|
||||
import fr.xephi.authme.datasource.AbstractResourceClosingTest;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.SQLite;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package fr.xephi.authme.converter;
|
||||
package fr.xephi.authme.datasource.converter;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.DataSourceType;
|
||||
import org.bukkit.command.CommandSender;
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
package fr.xephi.authme.converter;
|
||||
package fr.xephi.authme.datasource.converter;
|
||||
|
||||
import ch.jalu.injector.testing.DelayedInjectionRunner;
|
||||
import ch.jalu.injector.testing.InjectDelayed;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.initialization.DataFolder;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
@@ -45,7 +45,7 @@ public class CrazyLoginConverterTest {
|
||||
private Settings settings;
|
||||
|
||||
@DataFolder
|
||||
private File dataFolder = TestHelper.getJarFile(TestHelper.PROJECT_ROOT + "converter/");
|
||||
private File dataFolder = TestHelper.getJarFile(TestHelper.PROJECT_ROOT + "/datasource/converter/");
|
||||
|
||||
@BeforeClass
|
||||
public static void initializeLogger() {
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package fr.xephi.authme.converter;
|
||||
package fr.xephi.authme.datasource.converter;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.DataSourceType;
|
||||
import fr.xephi.authme.datasource.FlatFile;
|
||||
@@ -2,7 +2,6 @@ package fr.xephi.authme.geoip;
|
||||
|
||||
import com.maxmind.geoip.Country;
|
||||
import com.maxmind.geoip.LookupService;
|
||||
import fr.xephi.authme.geoip.GeoLiteAPI;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@@ -23,12 +22,12 @@ import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* Test for {@link GeoLiteAPI}.
|
||||
* Test for {@link GeoIpManager}.
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class GeoIpManagerTest {
|
||||
|
||||
private GeoLiteAPI geoLiteApi;
|
||||
private GeoIpManager geoIpManager;
|
||||
private File dataFolder;
|
||||
@Mock
|
||||
private LookupService lookupService;
|
||||
@@ -39,7 +38,7 @@ public class GeoIpManagerTest {
|
||||
@Before
|
||||
public void initializeGeoLiteApi() throws IOException {
|
||||
dataFolder = temporaryFolder.newFolder();
|
||||
geoLiteApi = new GeoLiteAPI(dataFolder, lookupService);
|
||||
geoIpManager = new GeoIpManager(dataFolder, lookupService);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -52,7 +51,7 @@ public class GeoIpManagerTest {
|
||||
given(lookupService.getCountry(ip)).willReturn(country);
|
||||
|
||||
// when
|
||||
String result = geoLiteApi.getCountryCode(ip);
|
||||
String result = geoIpManager.getCountryCode(ip);
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo(countryCode));
|
||||
@@ -65,7 +64,7 @@ public class GeoIpManagerTest {
|
||||
String ip = "127.0.0.1";
|
||||
|
||||
// when
|
||||
String result = geoLiteApi.getCountryCode(ip);
|
||||
String result = geoIpManager.getCountryCode(ip);
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo("--"));
|
||||
@@ -82,7 +81,7 @@ public class GeoIpManagerTest {
|
||||
given(lookupService.getCountry(ip)).willReturn(country);
|
||||
|
||||
// when
|
||||
String result = geoLiteApi.getCountryName(ip);
|
||||
String result = geoIpManager.getCountryName(ip);
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo(countryName));
|
||||
@@ -95,7 +94,7 @@ public class GeoIpManagerTest {
|
||||
String ip = "127.0.0.1";
|
||||
|
||||
// when
|
||||
String result = geoLiteApi.getCountryName(ip);
|
||||
String result = geoIpManager.getCountryName(ip);
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo("N/A"));
|
||||
|
||||
@@ -3,7 +3,7 @@ package fr.xephi.authme.listener;
|
||||
import ch.jalu.injector.testing.BeforeInjecting;
|
||||
import ch.jalu.injector.testing.DelayedInjectionRunner;
|
||||
import ch.jalu.injector.testing.InjectDelayed;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package fr.xephi.authme.listener;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.service.AntiBotService;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package fr.xephi.authme.listener;
|
||||
|
||||
import fr.xephi.authme.service.AntiBotService;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme.output;
|
||||
package fr.xephi.authme.message;
|
||||
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import org.junit.Test;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme.output;
|
||||
package fr.xephi.authme.message;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme.output;
|
||||
package fr.xephi.authme.message;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme.output;
|
||||
package fr.xephi.authme.message;
|
||||
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
@@ -33,8 +33,8 @@ import static org.mockito.Mockito.verify;
|
||||
*/
|
||||
public class MessagesIntegrationTest {
|
||||
|
||||
private static final String YML_TEST_FILE = TestHelper.PROJECT_ROOT + "output/messages_test.yml";
|
||||
private static final String YML_DEFAULT_TEST_FILE = TestHelper.PROJECT_ROOT + "output/messages_default.yml";
|
||||
private static final String YML_TEST_FILE = TestHelper.PROJECT_ROOT + "message/messages_test.yml";
|
||||
private static final String YML_DEFAULT_TEST_FILE = TestHelper.PROJECT_ROOT + "message/messages_default.yml";
|
||||
private Messages messages;
|
||||
|
||||
@BeforeClass
|
||||
@@ -256,7 +256,7 @@ public class MessagesIntegrationTest {
|
||||
assumeThat(messages.retrieveSingle(key), equalTo("§cWrong password!"));
|
||||
Settings settings = mock(Settings.class);
|
||||
given(settings.getMessagesFile()).willReturn(TestHelper.getJarFile(
|
||||
TestHelper.PROJECT_ROOT + "output/messages_test2.yml"));
|
||||
TestHelper.PROJECT_ROOT + "message/messages_test2.yml"));
|
||||
|
||||
// when
|
||||
messages.reload(settings);
|
||||
@@ -1,7 +1,7 @@
|
||||
package fr.xephi.authme.process;
|
||||
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.permission.AuthGroupHandler;
|
||||
import fr.xephi.authme.permission.AuthGroupType;
|
||||
import fr.xephi.authme.permission.PermissionNode;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package fr.xephi.authme.process.email;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package fr.xephi.authme.process.email;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package fr.xephi.authme.process.login;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.events.AuthMeAsyncPreLoginEvent;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package fr.xephi.authme.process.unregister;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.limbo.LimboCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.permission.AuthGroupHandler;
|
||||
import fr.xephi.authme.permission.AuthGroupType;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
|
||||
@@ -4,8 +4,8 @@ import ch.jalu.injector.testing.BeforeInjecting;
|
||||
import ch.jalu.injector.testing.DelayedInjectionRunner;
|
||||
import ch.jalu.injector.testing.InjectDelayed;
|
||||
import fr.xephi.authme.ReflectionTestUtils;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.permission.AdminPermission;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package fr.xephi.authme.service;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.security.crypts.SHA256;
|
||||
import fr.xephi.authme.service.MigrationService;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package fr.xephi.authme.service;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.cache.limbo.PlayerData;
|
||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.events.FirstSpawnTeleportEvent;
|
||||
import fr.xephi.authme.events.SpawnTeleportEvent;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.service.TeleportationService;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
@@ -237,7 +235,7 @@ public class TeleportationServiceTest {
|
||||
given(settings.getProperty(RestrictionSettings.NO_TELEPORT)).willReturn(true);
|
||||
Player player = mock(Player.class);
|
||||
PlayerAuth auth = mock(PlayerAuth.class);
|
||||
PlayerData limbo = mock(PlayerData.class);
|
||||
LimboPlayer limbo = mock(LimboPlayer.class);
|
||||
|
||||
// when
|
||||
teleportationService.teleportOnLogin(player, auth, limbo);
|
||||
@@ -255,7 +253,7 @@ public class TeleportationServiceTest {
|
||||
Location spawn = mockLocation();
|
||||
given(spawnLoader.getSpawnLocation(player)).willReturn(spawn);
|
||||
PlayerAuth auth = mock(PlayerAuth.class);
|
||||
PlayerData limbo = mock(PlayerData.class);
|
||||
LimboPlayer limbo = mock(LimboPlayer.class);
|
||||
Location limboLocation = mockLocation();
|
||||
given(limboLocation.getWorld().getName()).willReturn("forced1");
|
||||
given(limbo.getLocation()).willReturn(limboLocation);
|
||||
@@ -279,7 +277,7 @@ public class TeleportationServiceTest {
|
||||
Location spawn = mockLocation();
|
||||
given(spawnLoader.getSpawnLocation(player)).willReturn(spawn);
|
||||
PlayerAuth auth = mock(PlayerAuth.class);
|
||||
PlayerData limbo = mock(PlayerData.class);
|
||||
LimboPlayer limbo = mock(LimboPlayer.class);
|
||||
Location limboLocation = mockLocation();
|
||||
given(limboLocation.getWorld().getName()).willReturn("Forced1"); // different case
|
||||
given(limbo.getLocation()).willReturn(limboLocation);
|
||||
@@ -306,7 +304,7 @@ public class TeleportationServiceTest {
|
||||
|
||||
Player player = mock(Player.class);
|
||||
given(player.isOnline()).willReturn(true);
|
||||
PlayerData limbo = mock(PlayerData.class);
|
||||
LimboPlayer limbo = mock(LimboPlayer.class);
|
||||
Location limboLocation = mockLocation();
|
||||
given(limbo.getLocation()).willReturn(limboLocation);
|
||||
|
||||
@@ -335,7 +333,7 @@ public class TeleportationServiceTest {
|
||||
given(player.isOnline()).willReturn(true);
|
||||
World world = mock(World.class);
|
||||
given(player.getWorld()).willReturn(world);
|
||||
PlayerData limbo = mock(PlayerData.class);
|
||||
LimboPlayer limbo = mock(LimboPlayer.class);
|
||||
Location limboLocation = mockLocation();
|
||||
given(limbo.getLocation()).willReturn(limboLocation);
|
||||
|
||||
@@ -363,7 +361,7 @@ public class TeleportationServiceTest {
|
||||
given(player.isOnline()).willReturn(true);
|
||||
World world = mock(World.class);
|
||||
given(player.getWorld()).willReturn(world);
|
||||
PlayerData limbo = mock(PlayerData.class);
|
||||
LimboPlayer limbo = mock(LimboPlayer.class);
|
||||
Location location = mockLocation();
|
||||
given(limbo.getLocation()).willReturn(location);
|
||||
|
||||
@@ -388,7 +386,7 @@ public class TeleportationServiceTest {
|
||||
given(player.isOnline()).willReturn(true);
|
||||
World world = mock(World.class);
|
||||
given(player.getWorld()).willReturn(world);
|
||||
PlayerData limbo = mock(PlayerData.class);
|
||||
LimboPlayer limbo = mock(LimboPlayer.class);
|
||||
Location location = mockLocation();
|
||||
given(limbo.getLocation()).willReturn(location);
|
||||
|
||||
@@ -409,7 +407,7 @@ public class TeleportationServiceTest {
|
||||
|
||||
PlayerAuth auth = PlayerAuth.builder().name("bobby").build();
|
||||
Player player = mock(Player.class);
|
||||
PlayerData limbo = mock(PlayerData.class);
|
||||
LimboPlayer limbo = mock(LimboPlayer.class);
|
||||
|
||||
// when
|
||||
teleportationService.teleportOnLogin(player, auth, limbo);
|
||||
|
||||
@@ -5,11 +5,10 @@ import ch.jalu.injector.testing.DelayedInjectionRunner;
|
||||
import ch.jalu.injector.testing.InjectDelayed;
|
||||
import com.google.common.base.Strings;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.geoip.GeoLiteAPI;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.geoip.GeoIpManager;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.service.ValidationService;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.EmailSettings;
|
||||
import fr.xephi.authme.settings.properties.ProtectionSettings;
|
||||
@@ -46,7 +45,7 @@ public class ValidationServiceTest {
|
||||
@Mock
|
||||
private PermissionsManager permissionsManager;
|
||||
@Mock
|
||||
private GeoLiteAPI geoLiteApi;
|
||||
private GeoIpManager geoIpManager;
|
||||
|
||||
@BeforeInjecting
|
||||
public void createService() {
|
||||
@@ -267,7 +266,7 @@ public class ValidationServiceTest {
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo(true));
|
||||
verifyZeroInteractions(geoLiteApi);
|
||||
verifyZeroInteractions(geoIpManager);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -276,14 +275,14 @@ public class ValidationServiceTest {
|
||||
given(settings.getProperty(ProtectionSettings.COUNTRIES_WHITELIST)).willReturn(asList("ch", "it"));
|
||||
given(settings.getProperty(ProtectionSettings.COUNTRIES_BLACKLIST)).willReturn(Collections.<String>emptyList());
|
||||
String ip = "127.0.0.1";
|
||||
given(geoLiteApi.getCountryCode(ip)).willReturn("CH");
|
||||
given(geoIpManager.getCountryCode(ip)).willReturn("CH");
|
||||
|
||||
// when
|
||||
boolean result = validationService.isCountryAdmitted(ip);
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo(true));
|
||||
verify(geoLiteApi).getCountryCode(ip);
|
||||
verify(geoIpManager).getCountryCode(ip);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -292,14 +291,14 @@ public class ValidationServiceTest {
|
||||
given(settings.getProperty(ProtectionSettings.COUNTRIES_WHITELIST)).willReturn(asList("ch", "it"));
|
||||
given(settings.getProperty(ProtectionSettings.COUNTRIES_BLACKLIST)).willReturn(Collections.<String>emptyList());
|
||||
String ip = "123.45.67.89";
|
||||
given(geoLiteApi.getCountryCode(ip)).willReturn("BR");
|
||||
given(geoIpManager.getCountryCode(ip)).willReturn("BR");
|
||||
|
||||
// when
|
||||
boolean result = validationService.isCountryAdmitted(ip);
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo(false));
|
||||
verify(geoLiteApi).getCountryCode(ip);
|
||||
verify(geoIpManager).getCountryCode(ip);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -308,14 +307,14 @@ public class ValidationServiceTest {
|
||||
given(settings.getProperty(ProtectionSettings.COUNTRIES_WHITELIST)).willReturn(Collections.<String>emptyList());
|
||||
given(settings.getProperty(ProtectionSettings.COUNTRIES_BLACKLIST)).willReturn(asList("ch", "it"));
|
||||
String ip = "127.0.0.1";
|
||||
given(geoLiteApi.getCountryCode(ip)).willReturn("BR");
|
||||
given(geoIpManager.getCountryCode(ip)).willReturn("BR");
|
||||
|
||||
// when
|
||||
boolean result = validationService.isCountryAdmitted(ip);
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo(true));
|
||||
verify(geoLiteApi).getCountryCode(ip);
|
||||
verify(geoIpManager).getCountryCode(ip);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -324,14 +323,14 @@ public class ValidationServiceTest {
|
||||
given(settings.getProperty(ProtectionSettings.COUNTRIES_WHITELIST)).willReturn(Collections.<String>emptyList());
|
||||
given(settings.getProperty(ProtectionSettings.COUNTRIES_BLACKLIST)).willReturn(asList("ch", "it"));
|
||||
String ip = "123.45.67.89";
|
||||
given(geoLiteApi.getCountryCode(ip)).willReturn("IT");
|
||||
given(geoIpManager.getCountryCode(ip)).willReturn("IT");
|
||||
|
||||
// when
|
||||
boolean result = validationService.isCountryAdmitted(ip);
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo(false));
|
||||
verify(geoLiteApi).getCountryCode(ip);
|
||||
verify(geoIpManager).getCountryCode(ip);
|
||||
}
|
||||
|
||||
private static void assertErrorEquals(ValidationResult validationResult, MessageKey messageKey, String... args) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static fr.xephi.authme.settings.properties.PluginSettings.MESSAGES_LANGUAGE;
|
||||
import static fr.xephi.authme.util.StringUtils.makePath;
|
||||
import static fr.xephi.authme.util.FileUtils.makePath;
|
||||
import static org.hamcrest.Matchers.arrayContaining;
|
||||
import static org.hamcrest.Matchers.arrayWithSize;
|
||||
import static org.hamcrest.Matchers.endsWith;
|
||||
|
||||
+26
-26
@@ -1,11 +1,11 @@
|
||||
package fr.xephi.authme.task;
|
||||
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.PlayerData;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.limbo.LimboCache;
|
||||
import fr.xephi.authme.data.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
@@ -31,7 +31,7 @@ import static org.mockito.Mockito.verifyZeroInteractions;
|
||||
* Test for {@link PlayerDataTaskManager}.
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class PlayerDataTaskManagerTest {
|
||||
public class LimboPlayerTaskManagerTest {
|
||||
|
||||
@InjectMocks
|
||||
private PlayerDataTaskManager playerDataTaskManager;
|
||||
@@ -60,8 +60,8 @@ public class PlayerDataTaskManagerTest {
|
||||
public void shouldRegisterMessageTask() {
|
||||
// given
|
||||
String name = "bobby";
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
given(limboCache.getPlayerData(name)).willReturn(playerData);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
|
||||
MessageKey key = MessageKey.REGISTER_EMAIL_MESSAGE;
|
||||
given(messages.retrieve(key)).willReturn(new String[]{"Please register!"});
|
||||
BukkitTask bukkiTask = mock(BukkitTask.class);
|
||||
@@ -73,7 +73,7 @@ public class PlayerDataTaskManagerTest {
|
||||
playerDataTaskManager.registerMessageTask(name, false);
|
||||
|
||||
// then
|
||||
verify(playerData).setMessageTask(bukkiTask);
|
||||
verify(limboPlayer).setMessageTask(bukkiTask);
|
||||
verify(messages).retrieve(key);
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ public class PlayerDataTaskManagerTest {
|
||||
public void shouldNotScheduleTaskForZeroAsInterval() {
|
||||
// given
|
||||
String name = "Tester1";
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
given(limboCache.getPlayerData(name)).willReturn(playerData);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
|
||||
BukkitTask bukkiTask = mock(BukkitTask.class);
|
||||
given(bukkitService.runTask(any(MessageTask.class))).willReturn(bukkiTask);
|
||||
given(settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)).willReturn(0);
|
||||
@@ -107,18 +107,18 @@ public class PlayerDataTaskManagerTest {
|
||||
playerDataTaskManager.registerMessageTask(name, true);
|
||||
|
||||
// then
|
||||
verifyZeroInteractions(playerData, bukkitService);
|
||||
verifyZeroInteractions(limboPlayer, bukkitService);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldCancelExistingMessageTask() {
|
||||
// given
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
BukkitTask existingMessageTask = mock(BukkitTask.class);
|
||||
given(playerData.getMessageTask()).willReturn(existingMessageTask);
|
||||
given(limboPlayer.getMessageTask()).willReturn(existingMessageTask);
|
||||
|
||||
String name = "bobby";
|
||||
given(limboCache.getPlayerData(name)).willReturn(playerData);
|
||||
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
|
||||
given(messages.retrieve(MessageKey.REGISTER_EMAIL_MESSAGE))
|
||||
.willReturn(new String[]{"Please register", "Use /register"});
|
||||
|
||||
@@ -131,7 +131,7 @@ public class PlayerDataTaskManagerTest {
|
||||
playerDataTaskManager.registerMessageTask(name, false);
|
||||
|
||||
// then
|
||||
verify(playerData).setMessageTask(bukkiTask);
|
||||
verify(limboPlayer).setMessageTask(bukkiTask);
|
||||
verify(messages).retrieve(MessageKey.REGISTER_EMAIL_MESSAGE);
|
||||
verify(existingMessageTask).cancel();
|
||||
}
|
||||
@@ -142,8 +142,8 @@ public class PlayerDataTaskManagerTest {
|
||||
String name = "l33tPlayer";
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn(name);
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
given(limboCache.getPlayerData(name)).willReturn(playerData);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
|
||||
given(settings.getProperty(RestrictionSettings.TIMEOUT)).willReturn(30);
|
||||
BukkitTask bukkitTask = mock(BukkitTask.class);
|
||||
given(bukkitService.runTaskLater(any(TimeoutTask.class), anyLong())).willReturn(bukkitTask);
|
||||
@@ -152,7 +152,7 @@ public class PlayerDataTaskManagerTest {
|
||||
playerDataTaskManager.registerTimeoutTask(player);
|
||||
|
||||
// then
|
||||
verify(playerData).setTimeoutTask(bukkitTask);
|
||||
verify(limboPlayer).setTimeoutTask(bukkitTask);
|
||||
verify(bukkitService).runTaskLater(any(TimeoutTask.class), eq(600L)); // 30 * TICKS_PER_SECOND
|
||||
verify(messages).retrieveSingle(MessageKey.LOGIN_TIMEOUT_ERROR);
|
||||
}
|
||||
@@ -179,15 +179,15 @@ public class PlayerDataTaskManagerTest {
|
||||
String name = "snail";
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn(name);
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
given(limboCache.getPlayerData(name)).willReturn(playerData);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
|
||||
given(settings.getProperty(RestrictionSettings.TIMEOUT)).willReturn(0);
|
||||
|
||||
// when
|
||||
playerDataTaskManager.registerTimeoutTask(player);
|
||||
|
||||
// then
|
||||
verifyZeroInteractions(playerData, bukkitService);
|
||||
verifyZeroInteractions(limboPlayer, bukkitService);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -196,10 +196,10 @@ public class PlayerDataTaskManagerTest {
|
||||
String name = "l33tPlayer";
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn(name);
|
||||
PlayerData playerData = mock(PlayerData.class);
|
||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||
BukkitTask existingTask = mock(BukkitTask.class);
|
||||
given(playerData.getTimeoutTask()).willReturn(existingTask);
|
||||
given(limboCache.getPlayerData(name)).willReturn(playerData);
|
||||
given(limboPlayer.getTimeoutTask()).willReturn(existingTask);
|
||||
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
|
||||
given(settings.getProperty(RestrictionSettings.TIMEOUT)).willReturn(18);
|
||||
BukkitTask bukkitTask = mock(BukkitTask.class);
|
||||
given(bukkitService.runTaskLater(any(TimeoutTask.class), anyLong())).willReturn(bukkitTask);
|
||||
@@ -209,7 +209,7 @@ public class PlayerDataTaskManagerTest {
|
||||
|
||||
// then
|
||||
verify(existingTask).cancel();
|
||||
verify(playerData).setTimeoutTask(bukkitTask);
|
||||
verify(limboPlayer).setTimeoutTask(bukkitTask);
|
||||
verify(bukkitService).runTaskLater(any(TimeoutTask.class), eq(360L)); // 18 * TICKS_PER_SECOND
|
||||
verify(messages).retrieveSingle(MessageKey.LOGIN_TIMEOUT_ERROR);
|
||||
}
|
||||
@@ -119,6 +119,15 @@ public class FileUtilsTest {
|
||||
// Nothing happens
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldConstructPath() {
|
||||
// given/when
|
||||
String result = FileUtils.makePath("path", "to", "test-file.txt");
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo("path" + File.separator + "to" + File.separator + "test-file.txt"));
|
||||
}
|
||||
|
||||
private static void createFiles(File... files) throws IOException {
|
||||
for (File file : files) {
|
||||
boolean result = file.getParentFile().mkdirs() & file.createNewFile();
|
||||
|
||||
@@ -15,7 +15,7 @@ import static org.mockito.Mockito.doThrow;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
/**
|
||||
* Test for {@link Utils}.
|
||||
* Test for {@link PlayerUtils}.
|
||||
*/
|
||||
public class PlayerUtilsTest {
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package fr.xephi.authme.util;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
@@ -91,15 +90,6 @@ public class StringUtilsTest {
|
||||
assertThat(StringUtils.getDifference("test", "something"), greaterThan(0.88));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldConstructPath() {
|
||||
// given/when
|
||||
String result = StringUtils.makePath("path", "to", "test-file.txt");
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo("path" + File.separator + "to" + File.separator + "test-file.txt"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldHaveHiddenConstructor() {
|
||||
TestHelper.validateHasOnlyPrivateEmptyConstructor(StringUtils.class);
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.google.common.collect.Multimap;
|
||||
import fr.xephi.authme.ClassCollector;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.command.ExecutableCommand;
|
||||
import fr.xephi.authme.converter.Converter;
|
||||
import fr.xephi.authme.datasource.converter.Converter;
|
||||
import fr.xephi.authme.initialization.DataFolder;
|
||||
import fr.xephi.authme.process.AsynchronousProcess;
|
||||
import fr.xephi.authme.process.SynchronousProcess;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Multimap;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import tools.utils.FileUtils;
|
||||
|
||||
@@ -2,7 +2,7 @@ package tools.messages.translation;
|
||||
|
||||
import com.google.common.io.CharStreams;
|
||||
import com.google.gson.Gson;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@@ -2,7 +2,7 @@ package tools.messages.translation;
|
||||
|
||||
import com.google.common.io.Resources;
|
||||
import com.google.gson.Gson;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import tools.messages.MessageFileVerifier;
|
||||
|
||||
Reference in New Issue
Block a user