mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-09 04:11:50 +01:00
"De-deprecate" setUp and make it private
This commit is contained in:
parent
286a5aa0e4
commit
f064997840
@ -47,26 +47,7 @@ public class TestInit {
|
||||
return t;
|
||||
}
|
||||
|
||||
private static File getTestFolder() {
|
||||
File testFolder = new File("temporaryTestFolder");
|
||||
testFolder.mkdir();
|
||||
return testFolder;
|
||||
}
|
||||
|
||||
public static void clean() throws IOException {
|
||||
clean(getTestFolder());
|
||||
}
|
||||
|
||||
public static void clean(File testFolder) throws IOException {
|
||||
if (testFolder.exists() && testFolder.isDirectory()) {
|
||||
for (File f : testFolder.listFiles()) {
|
||||
Files.deleteIfExists(f.toPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated // Use Test.init instead.
|
||||
public void setUp(boolean clearOnStart) throws Exception {
|
||||
private void setUp(boolean clearOnStart) throws Exception {
|
||||
planMock = PowerMockito.mock(Plan.class);
|
||||
StaticHolder.setInstance(Plan.class, planMock);
|
||||
StaticHolder.setInstance(planMock.getClass(), planMock);
|
||||
@ -108,6 +89,24 @@ public class TestInit {
|
||||
when(planMock.fetch()).thenReturn(fetch);
|
||||
}
|
||||
|
||||
private static File getTestFolder() {
|
||||
File testFolder = new File("temporaryTestFolder");
|
||||
testFolder.mkdir();
|
||||
return testFolder;
|
||||
}
|
||||
|
||||
public static void clean() throws IOException {
|
||||
clean(getTestFolder());
|
||||
}
|
||||
|
||||
public static void clean(File testFolder) throws IOException {
|
||||
if (testFolder.exists() && testFolder.isDirectory()) {
|
||||
for (File f : testFolder.listFiles()) {
|
||||
Files.deleteIfExists(f.toPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Server mockServer() {
|
||||
Server mockServer = PowerMockito.mock(Server.class);
|
||||
when(mockServer.getIp()).thenReturn("0.0.0.0");
|
||||
|
Loading…
Reference in New Issue
Block a user