[Fix] Tests fail when server is running

This commit is contained in:
Rsl1122 2018-10-25 11:23:06 +03:00
parent 633f5ba98a
commit 04c831b9b3
2 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import com.djrapitops.plan.system.database.databases.sql.SQLDB;
import com.djrapitops.plan.system.database.databases.sql.SQLiteDB;
import com.djrapitops.plan.system.database.databases.sql.tables.*;
import com.djrapitops.plan.system.info.server.Server;
import com.djrapitops.plan.system.settings.Settings;
import com.djrapitops.plan.utilities.Base64Util;
import com.djrapitops.plan.utilities.SHA256Hash;
import org.junit.*;
@ -77,6 +78,7 @@ public class SQLiteTest {
.withServer();
PlanBukkitComponent component = DaggerPlanBukkitComponent.builder().plan(mockUtil.getPlanMock()).build();
system = component.system();
system.getConfigSystem().getConfig().set(Settings.WEBSERVER_PORT, 9005);
system.enable();
dbSystem = system.getDatabaseSystem();

View File

@ -4,6 +4,7 @@ import com.djrapitops.plan.DaggerPlanBukkitComponent;
import com.djrapitops.plan.PlanBukkitComponent;
import com.djrapitops.plan.api.exceptions.EnableException;
import com.djrapitops.plan.system.PlanSystem;
import com.djrapitops.plan.system.settings.Settings;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
@ -35,6 +36,7 @@ public class NetworkSettingsTest {
@Test
public void transferDoesNotProduceException() throws EnableException {
PlanSystem system = COMPONENT.system();
system.getConfigSystem().getConfig().set(Settings.WEBSERVER_PORT, 9005);
system.enable();
NetworkSettings networkSettings = system.getConfigSystem().getConfig().getNetworkSettings();