Fixed test flakiness caused by Settings finality.

This commit is contained in:
Rsl1122 2018-02-04 12:54:31 +02:00
parent dfb5f39918
commit a78060acf9
3 changed files with 14 additions and 5 deletions

View File

@ -7,10 +7,7 @@ package com.djrapitops.plan.system;
import com.djrapitops.plan.Plan;
import com.djrapitops.plan.api.exceptions.EnableException;
import com.djrapitops.plan.system.settings.Settings;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.*;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
@ -41,6 +38,11 @@ public class BukkitSystemTest {
planMock = mockUtil.getPlanMock();
}
@Before
public void setUp() {
Teardown.resetSettingsTempValues();
}
@After
public void tearDown() {
if (bukkitSystem != null) {

View File

@ -27,7 +27,7 @@ import java.util.UUID;
/**
* @author Rsl1122
*/
@RunWith(MockitoJUnitRunner.class)
@RunWith(MockitoJUnitRunner.Silent.class)
public class BungeeBukkitConnectionTest {
@ClassRule
@ -65,6 +65,7 @@ public class BungeeBukkitConnectionTest {
@Before
public void setUp() {
Teardown.resetSettingsTempValues();
Settings.DEBUG.setTemporaryValue("console");
Settings.DEV_MODE.setTemporaryValue(true);
}

View File

@ -42,6 +42,12 @@ public class BungeeSystemTest {
planMock = mockUtil.getPlanMock();
}
@Before
public void setUp() {
Teardown.resetSettingsTempValues();
}
@After
public void tearDown() {
if (bungeeSystem != null) {