"De-deprecate" setUp and make it private

This commit is contained in:
Fuzzlemann 2017-08-15 22:05:30 +02:00
parent 286a5aa0e4
commit f064997840

View File

@ -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");