use of org.bukkit.plugin.java.JavaPluginLoader in project AuthMeReloaded by AuthMe.
the class AuthMeInitializationTest method initAuthMe.
@Before
public void initAuthMe() throws IOException {
dataFolder = temporaryFolder.newFolder();
File settingsFile = new File(dataFolder, "config.yml");
JavaPluginLoader pluginLoader = new JavaPluginLoader(server);
Files.copy(TestHelper.getJarFile(TestHelper.PROJECT_ROOT + "config.test.yml"), settingsFile);
// Mock / wire various Bukkit components
given(server.getLogger()).willReturn(mock(Logger.class));
ReflectionTestUtils.setField(Bukkit.class, null, "server", server);
given(server.getPluginManager()).willReturn(pluginManager);
// PluginDescriptionFile is final: need to create a sample one
PluginDescriptionFile descriptionFile = new PluginDescriptionFile("AuthMe", "N/A", AuthMe.class.getCanonicalName());
// Initialize AuthMe
authMe = new AuthMe(pluginLoader, descriptionFile, dataFolder, null);
}
Aggregations