Added Locale to TestInit

This commit is contained in:
Rsl1122 2017-08-16 12:55:08 +03:00
parent 174eaa7f31
commit baec9dd220

View File

@ -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.
* <p>
* Does not load any messages from anywhere because that would cause exceptions.
*/
public static void initEmptyLocale() {
new Locale(null);
}
/**
* Init locale with mocked Plan.
* <p>
* 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() {