Remove public modifier on JUnit5 lifecycle methods
See gh-17292
This commit is contained in:
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
class RemoteUrlPropertyExtractorTests {
|
||||
|
||||
@AfterEach
|
||||
public void preventRunFailuresFromPollutingLoggerContext() {
|
||||
void preventRunFailuresFromPollutingLoggerContext() {
|
||||
((Logger) LoggerFactory.getLogger(RemoteUrlPropertyExtractorTests.class)).getLoggerContext()
|
||||
.getTurboFilterList().clear();
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ import static org.mockito.Mockito.verify;
|
||||
class DevToolsPooledDataSourceAutoConfigurationTests extends AbstractDevToolsDataSourceAutoConfigurationTests {
|
||||
|
||||
@BeforeEach
|
||||
public void before(@TempDir File tempDir) throws IOException {
|
||||
void before(@TempDir File tempDir) throws IOException {
|
||||
System.setProperty("derby.stream.error.file", new File(tempDir, "derby.log").getAbsolutePath());
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void after() {
|
||||
void after() {
|
||||
System.clearProperty("derby.stream.error.file");
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class LocalDevToolsAutoConfigurationTests {
|
||||
private ConfigurableApplicationContext context;
|
||||
|
||||
@AfterEach
|
||||
public void cleanup() {
|
||||
void cleanup() {
|
||||
if (this.context != null) {
|
||||
this.context.close();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class OnEnabledDevToolsConditionTests {
|
||||
private AnnotationConfigApplicationContext context;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.context = new AnnotationConfigApplicationContext();
|
||||
this.context.register(TestConfiguration.class);
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ class RemoteDevToolsAutoConfigurationTests {
|
||||
private MockFilterChain chain;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.request = new MockHttpServletRequest();
|
||||
this.response = new MockHttpServletResponse();
|
||||
this.chain = new MockFilterChain();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void close() {
|
||||
void close() {
|
||||
if (this.context != null) {
|
||||
this.context.close();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class ClassPathFileChangeListenerTests {
|
||||
private ArgumentCaptor<ApplicationEvent> eventCaptor;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,12 +50,12 @@ class DevToolPropertiesIntegrationTests {
|
||||
private ConfigurableApplicationContext context;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
Restarter.initialize(new String[] {}, false, new MockInitializer(), false);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void cleanup() {
|
||||
void cleanup() {
|
||||
if (this.context != null) {
|
||||
this.context.close();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class DevToolsHomePropertiesPostProcessorTests {
|
||||
private File home;
|
||||
|
||||
@BeforeEach
|
||||
public void setup(@TempDir File tempDir) throws IOException {
|
||||
void setup(@TempDir File tempDir) throws IOException {
|
||||
this.home = tempDir;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class FileSystemWatcherTests {
|
||||
File tempDir;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
setupWatcher(20, 10);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class FolderSnapshotTests {
|
||||
private FolderSnapshot initialSnapshot;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
this.folder = createTestFolderStructure();
|
||||
this.initialSnapshot = new FolderSnapshot(this.folder);
|
||||
}
|
||||
|
||||
@@ -60,13 +60,13 @@ class LiveReloadServerTests {
|
||||
private MonitoredLiveReloadServer server;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
void setUp() throws Exception {
|
||||
this.server = new MonitoredLiveReloadServer(0);
|
||||
this.port = this.server.start();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() throws Exception {
|
||||
void tearDown() throws Exception {
|
||||
this.server.stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class ClassPathChangeUploaderTests {
|
||||
private ClassPathChangeUploader uploader;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.requestFactory = new MockClientHttpRequestFactory();
|
||||
this.uploader = new ClassPathChangeUploader("http://localhost/upload", this.requestFactory);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class DelayedLiveReloadTriggerTests {
|
||||
private DelayedLiveReloadTrigger trigger;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws IOException {
|
||||
void setup() throws IOException {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
given(this.errorRequest.execute()).willReturn(this.errorResponse);
|
||||
given(this.okRequest.execute()).willReturn(this.okResponse);
|
||||
|
||||
@@ -60,7 +60,7 @@ class HttpHeaderInterceptorTests {
|
||||
private MockHttpServletRequest httpRequest;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.body = new byte[] {};
|
||||
this.httpRequest = new MockHttpServletRequest();
|
||||
|
||||
@@ -68,7 +68,7 @@ class RemoteClientConfigurationTests {
|
||||
private AnnotationConfigApplicationContext clientContext;
|
||||
|
||||
@AfterEach
|
||||
public void cleanup() {
|
||||
void cleanup() {
|
||||
if (this.context != null) {
|
||||
this.context.close();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class DispatcherFilterTests {
|
||||
private DispatcherFilter filter;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.filter = new DispatcherFilter(this.dispatcher);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class DispatcherTests {
|
||||
private ServerHttpResponse serverResponse;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.request = new MockHttpServletRequest();
|
||||
this.response = new MockHttpServletResponse();
|
||||
|
||||
@@ -45,7 +45,7 @@ class HttpHeaderAccessManagerTests {
|
||||
private HttpHeaderAccessManager manager;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.request = new MockHttpServletRequest("GET", "/");
|
||||
this.serverRequest = new ServletServerHttpRequest(this.request);
|
||||
this.manager = new HttpHeaderAccessManager(HEADER, SECRET);
|
||||
|
||||
@@ -46,7 +46,7 @@ class HttpStatusHandlerTests {
|
||||
private ServerHttpRequest request;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.servletRequest = new MockHttpServletRequest();
|
||||
this.servletResponse = new MockHttpServletResponse();
|
||||
this.request = new ServletServerHttpRequest(this.servletRequest);
|
||||
|
||||
@@ -58,7 +58,7 @@ class ClassLoaderFilesResourcePatternResolverTests {
|
||||
private ClassLoaderFilesResourcePatternResolver resolver;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.files = new ClassLoaderFiles();
|
||||
this.resolver = new ClassLoaderFilesResourcePatternResolver(new GenericApplicationContext(), this.files);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class MainMethodTests {
|
||||
private Method actualMain;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
this.actualMain = Valid.class.getMethod("main", String[].class);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class OnInitializedRestarterConditionTests {
|
||||
|
||||
@BeforeEach
|
||||
@AfterEach
|
||||
public void cleanup() {
|
||||
void cleanup() {
|
||||
Restarter.clearInstance();
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class RestartApplicationListenerTests {
|
||||
|
||||
@BeforeEach
|
||||
@AfterEach
|
||||
public void cleanup() {
|
||||
void cleanup() {
|
||||
Restarter.clearInstance();
|
||||
System.clearProperty(ENABLED_PROPERTY);
|
||||
}
|
||||
|
||||
@@ -59,12 +59,12 @@ import static org.mockito.Mockito.verifyZeroInteractions;
|
||||
class RestarterTests {
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
RestarterInitializer.setRestarterInstance();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void cleanup() {
|
||||
void cleanup() {
|
||||
Restarter.clearInstance();
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class RestartClassLoaderTests {
|
||||
private RestartClassLoader reloadClassLoader;
|
||||
|
||||
@BeforeEach
|
||||
public void setup(@TempDir File tempDir) throws Exception {
|
||||
void setup(@TempDir File tempDir) throws Exception {
|
||||
this.sampleJarFile = createSampleJarFile(tempDir);
|
||||
URL url = this.sampleJarFile.toURI().toURL();
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
@@ -74,7 +74,7 @@ class RestartClassLoaderTests {
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() throws Exception {
|
||||
void tearDown() throws Exception {
|
||||
this.reloadClassLoader.close();
|
||||
this.parentClassLoader.close();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class HttpRestartServerTests {
|
||||
private ArgumentCaptor<ClassLoaderFiles> filesCaptor;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.server = new HttpRestartServer(this.delegate);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class HttpTunnelConnectionTests {
|
||||
private MockClientHttpRequestFactory requestFactory = new MockClientHttpRequestFactory();
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.url = "http://localhost:12345";
|
||||
this.incomingData = new ByteArrayOutputStream();
|
||||
|
||||
@@ -81,7 +81,7 @@ class HttpTunnelServerTests {
|
||||
private MockServerChannel serverChannel;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.server = new HttpTunnelServer(this.serverConnection);
|
||||
given(this.serverConnection.open(anyInt())).willAnswer((invocation) -> {
|
||||
|
||||
@@ -44,7 +44,7 @@ class SocketTargetServerConnectionTests {
|
||||
private SocketTargetServerConnection connection;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws IOException {
|
||||
void setup() throws IOException {
|
||||
this.server = new MockServer();
|
||||
this.connection = new SocketTargetServerConnection(() -> this.server.getPort());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user