diff --git a/Plan/test/test/java/utils/TestInit.java b/Plan/test/test/java/utils/TestInit.java index 9c20b0d10..ebf327447 100644 --- a/Plan/test/test/java/utils/TestInit.java +++ b/Plan/test/test/java/utils/TestInit.java @@ -8,6 +8,7 @@ import com.djrapitops.plugin.utilities.status.ProcessStatus; import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.ServerVariableHolder; import main.java.com.djrapitops.plan.Settings; +import main.java.com.djrapitops.plan.locale.Locale; import org.bukkit.OfflinePlayer; import org.bukkit.Server; import org.bukkit.configuration.InvalidConfigurationException; @@ -35,6 +36,26 @@ public class TestInit { public TestInit() { } + /** + * Init locale with empty messages. + *

+ * Does not load any messages from anywhere because that would cause exceptions. + */ + public static void initEmptyLocale() { + new Locale(null); + } + + /** + * Init locale with mocked Plan. + *

+ * requires getDataFolder mock. + * + * @param plan Mocked Plan + */ + public static void initLocale(Plan plan) { + new Locale(plan).loadLocale(); + } + public static TestInit init() throws Exception { TestInit t = new TestInit(); t.setUp(true); @@ -87,6 +108,7 @@ public class TestInit { when(planMock.getVariable()).thenReturn(serverVariableHolder); when(planMock.processStatus()).thenReturn(process); when(planMock.fetch()).thenReturn(fetch); + initLocale(planMock); } private static File getTestFolder() {