Remove public modifier on JUnit5 lifecycle methods
See gh-17292
This commit is contained in:
@@ -62,14 +62,14 @@ class PropertiesLauncherTests {
|
||||
private CapturedOutput capturedOutput;
|
||||
|
||||
@BeforeEach
|
||||
public void setup(CapturedOutput capturedOutput) {
|
||||
void setup(CapturedOutput capturedOutput) {
|
||||
this.contextClassLoader = Thread.currentThread().getContextClassLoader();
|
||||
System.setProperty("loader.home", new File("src/test/resources").getAbsolutePath());
|
||||
this.capturedOutput = capturedOutput;
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void close() {
|
||||
void close() {
|
||||
Thread.currentThread().setContextClassLoader(this.contextClassLoader);
|
||||
System.clearProperty("loader.home");
|
||||
System.clearProperty("loader.path");
|
||||
|
||||
@@ -55,7 +55,7 @@ class ExplodedArchiveTests {
|
||||
private ExplodedArchive archive;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
createArchive();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,12 +58,12 @@ class JarFileArchiveTests {
|
||||
private String rootJarFileUrl;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
setup(false);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() throws Exception {
|
||||
void tearDown() throws Exception {
|
||||
this.archive.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class RandomAccessDataFileTests {
|
||||
private InputStream inputStream;
|
||||
|
||||
@BeforeEach
|
||||
public void setup(@TempDir File tempDir) throws Exception {
|
||||
void setup(@TempDir File tempDir) throws Exception {
|
||||
this.tempFile = new File(tempDir, "tempFile");
|
||||
FileOutputStream outputStream = new FileOutputStream(this.tempFile);
|
||||
outputStream.write(BYTES);
|
||||
@@ -71,7 +71,7 @@ class RandomAccessDataFileTests {
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void cleanup() throws Exception {
|
||||
void cleanup() throws Exception {
|
||||
this.inputStream.close();
|
||||
this.file.close();
|
||||
}
|
||||
|
||||
@@ -45,14 +45,14 @@ class CentralDirectoryParserTests {
|
||||
private RandomAccessDataFile jarData;
|
||||
|
||||
@BeforeEach
|
||||
public void setup(@TempDir File tempDir) throws Exception {
|
||||
void setup(@TempDir File tempDir) throws Exception {
|
||||
this.jarFile = new File(tempDir, "test.jar");
|
||||
TestJarCreator.createTestJar(this.jarFile);
|
||||
this.jarData = new RandomAccessDataFile(this.jarFile);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() throws IOException {
|
||||
void tearDown() throws IOException {
|
||||
this.jarData.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class JarFileTests {
|
||||
private JarFile jarFile;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
this.rootJarFile = new File(this.tempDir, "root.jar");
|
||||
TestJarCreator.createTestJar(this.rootJarFile);
|
||||
this.jarFile = new JarFile(this.rootJarFile);
|
||||
|
||||
@@ -47,14 +47,14 @@ class JarURLConnectionTests {
|
||||
private JarFile jarFile;
|
||||
|
||||
@BeforeEach
|
||||
public void setup(@TempDir File tempDir) throws Exception {
|
||||
void setup(@TempDir File tempDir) throws Exception {
|
||||
this.rootJarFile = new File(tempDir, "root.jar");
|
||||
TestJarCreator.createTestJar(this.rootJarFile);
|
||||
this.jarFile = new JarFile(this.rootJarFile);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() throws Exception {
|
||||
void tearDown() throws Exception {
|
||||
this.jarFile.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SystemPropertyUtilsTests {
|
||||
|
||||
@BeforeEach
|
||||
public void init() {
|
||||
void init() {
|
||||
System.setProperty("foo", "bar");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void close() {
|
||||
void close() {
|
||||
System.clearProperty("foo");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user