Remove public modifier on JUnit5 lifecycle methods

See gh-17292
This commit is contained in:
Stephane Nicoll
2019-06-21 18:09:05 +02:00
parent c7d3b7a9f1
commit e560b7f6ba
310 changed files with 361 additions and 362 deletions

View File

@@ -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();
}

View File

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

View File

@@ -77,7 +77,7 @@ class LocalDevToolsAutoConfigurationTests {
private ConfigurableApplicationContext context;
@AfterEach
public void cleanup() {
void cleanup() {
if (this.context != null) {
this.context.close();
}

View File

@@ -38,7 +38,7 @@ class OnEnabledDevToolsConditionTests {
private AnnotationConfigApplicationContext context;
@BeforeEach
public void setup() {
void setup() {
this.context = new AnnotationConfigApplicationContext();
this.context.register(TestConfiguration.class);
}

View File

@@ -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();
}

View File

@@ -60,7 +60,7 @@ class ClassPathFileChangeListenerTests {
private ArgumentCaptor<ApplicationEvent> eventCaptor;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
}

View File

@@ -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();
}

View File

@@ -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;
}

View File

@@ -55,7 +55,7 @@ class FileSystemWatcherTests {
File tempDir;
@BeforeEach
public void setup() {
void setup() {
setupWatcher(20, 10);
}

View File

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

View File

@@ -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();
}

View File

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

View File

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

View File

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

View File

@@ -68,7 +68,7 @@ class RemoteClientConfigurationTests {
private AnnotationConfigApplicationContext clientContext;
@AfterEach
public void cleanup() {
void cleanup() {
if (this.context != null) {
this.context.close();
}

View File

@@ -66,7 +66,7 @@ class DispatcherFilterTests {
private DispatcherFilter filter;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.filter = new DispatcherFilter(this.dispatcher);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -43,7 +43,7 @@ class OnInitializedRestarterConditionTests {
@BeforeEach
@AfterEach
public void cleanup() {
void cleanup() {
Restarter.clearInstance();
}

View File

@@ -53,7 +53,7 @@ class RestartApplicationListenerTests {
@BeforeEach
@AfterEach
public void cleanup() {
void cleanup() {
Restarter.clearInstance();
System.clearProperty(ENABLED_PROPERTY);
}

View File

@@ -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();
}

View File

@@ -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();
}

View File

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

View File

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

View File

@@ -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) -> {

View File

@@ -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());
}