mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-01-01 21:47:35 +01:00
commit
3ce6d06f1c
2
pom.xml
2
pom.xml
@ -62,7 +62,7 @@
|
|||||||
<bukkitplugin.authors>Xephi, sgdc3, DNx5, timvisee, games647, ljacqu, Gnat008</bukkitplugin.authors>
|
<bukkitplugin.authors>Xephi, sgdc3, DNx5, timvisee, games647, ljacqu, Gnat008</bukkitplugin.authors>
|
||||||
|
|
||||||
<!-- Change Bukkit Version HERE! -->
|
<!-- Change Bukkit Version HERE! -->
|
||||||
<bukkit.version>1.10.2-R0.1-SNAPSHOT</bukkit.version>
|
<bukkit.version>1.11-R0.1-SNAPSHOT</bukkit.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- Jenkins profile -->
|
<!-- Jenkins profile -->
|
||||||
|
@ -40,9 +40,9 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.plugin.PluginLoader;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.plugin.java.JavaPluginLoader;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -85,9 +85,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@SuppressWarnings("deprecation") // the super constructor is deprecated to mark it for unit testing only
|
@SuppressWarnings("deprecation") // the super constructor is deprecated to mark it for unit testing only
|
||||||
protected AuthMe(final PluginLoader loader, final Server server, final PluginDescriptionFile description,
|
protected AuthMe(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
|
||||||
final File dataFolder, final File file) {
|
super(loader, description, dataFolder, file);
|
||||||
super(loader, server, description, dataFolder, file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,8 +19,8 @@ import fr.xephi.authme.task.purge.PurgeService;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.plugin.PluginLoader;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
|
import org.bukkit.plugin.java.JavaPluginLoader;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
@ -49,9 +49,6 @@ import static org.mockito.Mockito.mock;
|
|||||||
@RunWith(MockitoJUnitRunner.class)
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
public class AuthMeInitializationTest {
|
public class AuthMeInitializationTest {
|
||||||
|
|
||||||
@Mock
|
|
||||||
private PluginLoader pluginLoader;
|
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
private Server server;
|
private Server server;
|
||||||
|
|
||||||
@ -60,7 +57,6 @@ public class AuthMeInitializationTest {
|
|||||||
|
|
||||||
private AuthMe authMe;
|
private AuthMe authMe;
|
||||||
private File dataFolder;
|
private File dataFolder;
|
||||||
private File settingsFile;
|
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public TemporaryFolder temporaryFolder = new TemporaryFolder();
|
public TemporaryFolder temporaryFolder = new TemporaryFolder();
|
||||||
@ -73,7 +69,8 @@ public class AuthMeInitializationTest {
|
|||||||
@Before
|
@Before
|
||||||
public void initAuthMe() throws IOException {
|
public void initAuthMe() throws IOException {
|
||||||
dataFolder = temporaryFolder.newFolder();
|
dataFolder = temporaryFolder.newFolder();
|
||||||
settingsFile = new File(dataFolder, "config.yml");
|
File settingsFile = new File(dataFolder, "config.yml");
|
||||||
|
JavaPluginLoader pluginLoader = new JavaPluginLoader(server);
|
||||||
Files.copy(TestHelper.getJarFile(TestHelper.PROJECT_ROOT + "config.test.yml"), settingsFile);
|
Files.copy(TestHelper.getJarFile(TestHelper.PROJECT_ROOT + "config.test.yml"), settingsFile);
|
||||||
|
|
||||||
// Mock / wire various Bukkit components
|
// Mock / wire various Bukkit components
|
||||||
@ -86,7 +83,7 @@ public class AuthMeInitializationTest {
|
|||||||
"AuthMe", "N/A", AuthMe.class.getCanonicalName());
|
"AuthMe", "N/A", AuthMe.class.getCanonicalName());
|
||||||
|
|
||||||
// Initialize AuthMe
|
// Initialize AuthMe
|
||||||
authMe = new AuthMe(pluginLoader, server, descriptionFile, dataFolder, null);
|
authMe = new AuthMe(pluginLoader, descriptionFile, dataFolder, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user