#450 Fix copying of JAR files to plugin folder
- Create SettingsMigrationService#copyFileFromResource (inspired from CustomSettings) - Use new method to copy missing files in plugin folder from JAR - Create YamlFileConfiguration inside NewSetting: FileConfiguration object provided by JavaPlugin#getConfig() sets default values from the JAR's config.yml :( - Change ConsoleLogger to take logger from plugin (work in progress)
This commit is contained in:
@@ -219,8 +219,8 @@ public class Log4JFilterTest {
|
||||
* Mocks a {@link Message} object and makes it return the given formatted message.
|
||||
*
|
||||
* @param formattedMessage the formatted message the mock should return
|
||||
|
||||
* @return Message mock */
|
||||
* @return Message mock
|
||||
*/
|
||||
private static Message mockMessage(String formattedMessage) {
|
||||
Message message = Mockito.mock(Message.class);
|
||||
when(message.getFormattedMessage()).thenReturn(formattedMessage);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package fr.xephi.authme.output;
|
||||
|
||||
import fr.xephi.authme.ConsoleLoggerTestInitializer;
|
||||
import fr.xephi.authme.util.WrapperMock;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mockito;
|
||||
@@ -27,6 +29,12 @@ public class MessagesIntegrationTest {
|
||||
private static final String YML_TEST_FILE = "messages_test.yml";
|
||||
private Messages messages;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() {
|
||||
WrapperMock.createInstance();
|
||||
ConsoleLoggerTestInitializer.setupLogger();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the messages in the file {@code messages_test.yml} in the test resources folder.
|
||||
* The file does not contain all messages defined in {@link MessageKey} and its contents
|
||||
@@ -34,8 +42,6 @@ public class MessagesIntegrationTest {
|
||||
*/
|
||||
@Before
|
||||
public void setUpMessages() {
|
||||
WrapperMock.createInstance();
|
||||
|
||||
URL url = getClass().getClassLoader().getResource(YML_TEST_FILE);
|
||||
if (url == null) {
|
||||
throw new RuntimeException("File '" + YML_TEST_FILE + "' could not be loaded");
|
||||
|
||||
Reference in New Issue
Block a user