#927 Fix Settings initialization and failing tests

This commit is contained in:
ljacqu
2016-09-03 11:30:03 +02:00
parent b8153c2578
commit 34a2b46768
3 changed files with 16 additions and 14 deletions
@@ -41,6 +41,7 @@ public class Settings extends SettingsManager {
List<PropertyEntry> knownProperties) {
super(resource, migrationService, knownProperties);
this.pluginFolder = pluginFolder;
loadSettingsFromFiles();
}
/**
@@ -79,19 +80,18 @@ public class Settings extends SettingsManager {
return welcomeMessage;
}
@Override
protected void validateAndLoadOptions() {
if (migrationService.checkAndMigrate(resource, knownProperties)) {
ConsoleLogger.info("Merged new config options");
ConsoleLogger.info("Please check your config.yml file for new settings!");
save();
}
private void loadSettingsFromFiles() {
messagesFile = buildMessagesFile();
welcomeMessage = readWelcomeMessage();
emailMessage = readEmailMessage();
}
@Override
public void reload() {
super.reload();
loadSettingsFromFiles();
}
private File buildMessagesFile() {
String languageCode = getProperty(PluginSettings.MESSAGES_LANGUAGE);