Remove public modifier on JUnit5 lifecycle methods
See gh-17292
This commit is contained in:
@@ -50,7 +50,7 @@ class CorsSampleActuatorApplicationTests {
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
RestTemplateBuilder builder = new RestTemplateBuilder();
|
||||
LocalHostUriTemplateHandler handler = new LocalHostUriTemplateHandler(this.applicationContext.getEnvironment(),
|
||||
"http");
|
||||
|
||||
@@ -38,12 +38,12 @@ class SampleAopApplicationTests {
|
||||
private String profiles;
|
||||
|
||||
@BeforeEach
|
||||
public void init() {
|
||||
void init() {
|
||||
this.profiles = System.getProperty("spring.profiles.active");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void after() {
|
||||
void after() {
|
||||
if (this.profiles != null) {
|
||||
System.setProperty("spring.profiles.active", this.profiles);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class SampleDataJdbcApplicationTests {
|
||||
private MockMvc mvc;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class SampleDataJpaApplicationTests {
|
||||
private MockMvc mvc;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class SampleDataRestApplicationTests {
|
||||
private MockMvc mvc;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class SampleIntegrationApplicationTests {
|
||||
private ConfigurableApplicationContext context;
|
||||
|
||||
@AfterEach
|
||||
public void stop() {
|
||||
void stop() {
|
||||
if (this.context != null) {
|
||||
this.context.close();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class SampleJpaApplicationTests {
|
||||
private MockMvc mvc;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@ class SampleProfileApplicationTests {
|
||||
private String profiles;
|
||||
|
||||
@BeforeEach
|
||||
public void before() {
|
||||
void before() {
|
||||
this.profiles = System.getProperty("spring.profiles.active");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void after() {
|
||||
void after() {
|
||||
if (this.profiles != null) {
|
||||
System.setProperty("spring.profiles.active", this.profiles);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class SamplePropertyValidationApplicationTests {
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@AfterEach
|
||||
public void closeContext() {
|
||||
void closeContext() {
|
||||
this.context.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ class SampleSecureApplicationTests {
|
||||
private Authentication authentication;
|
||||
|
||||
@BeforeEach
|
||||
public void init() {
|
||||
void init() {
|
||||
this.authentication = new UsernamePasswordAuthenticationToken("user", "password");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void close() {
|
||||
void close() {
|
||||
SecurityContextHolder.clearContext();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ class SampleSimpleApplicationTests {
|
||||
private String profiles;
|
||||
|
||||
@BeforeEach
|
||||
public void init() {
|
||||
void init() {
|
||||
this.profiles = System.getProperty("spring.profiles.active");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void after() {
|
||||
void after() {
|
||||
if (this.profiles != null) {
|
||||
System.setProperty("spring.profiles.active", this.profiles);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class SampleTestApplicationWebIntegrationTests {
|
||||
private VehicleDetailsService vehicleDetailsService;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
given(this.vehicleDetailsService.getVehicleDetails(VIN)).willReturn(new VehicleDetails("Honda", "Civic"));
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class UserVehicleServiceTests {
|
||||
private UserVehicleService service;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.service = new UserVehicleService(this.userRepository, this.vehicleDetailsService);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class MessageControllerWebTests {
|
||||
private MockMvc mockMvc;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class MessageControllerWebTests {
|
||||
private MockMvc mockMvc;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class SampleWsApplicationTests {
|
||||
private int serverPort;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
this.webServiceTemplate.setDefaultUri("http://localhost:" + this.serverPort + "/services/");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user