Testing - change to non-reflection WrapperMock test setup

Replaced many classes to use Wrapper to get singletons and replaced the test setups to use the WrapperMock instead of setting fields through reflection
This commit is contained in:
ljacqu
2015-11-26 22:53:12 +01:00
parent 77f2f80eaf
commit 210b691353
14 changed files with 69 additions and 57 deletions
@@ -1,6 +1,7 @@
package fr.xephi.authme.util;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.settings.Messages;
import org.bukkit.Server;
import org.bukkit.scheduler.BukkitScheduler;
@@ -72,6 +73,11 @@ public class WrapperMock extends Wrapper {
return getMock(Messages.class);
}
@Override
public PlayerCache getPlayerCache() {
return getMock(PlayerCache.class);
}
@Override
public File getDataFolder() {
if (singleton.getDataFolderValue != null) {