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

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

View File

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

View File

@@ -44,7 +44,7 @@ class SampleDataJdbcApplicationTests {
private MockMvc mvc;
@BeforeEach
public void setUp() {
void setUp() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
}

View File

@@ -53,7 +53,7 @@ class SampleDataJpaApplicationTests {
private MockMvc mvc;
@BeforeEach
public void setUp() {
void setUp() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
}

View File

@@ -49,7 +49,7 @@ class SampleDataRestApplicationTests {
private MockMvc mvc;
@BeforeEach
public void setUp() {
void setUp() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
}

View File

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

View File

@@ -46,7 +46,7 @@ class SampleJpaApplicationTests {
private MockMvc mvc;
@BeforeEach
public void setUp() {
void setUp() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
}

View File

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

View File

@@ -38,7 +38,7 @@ class SamplePropertyValidationApplicationTests {
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
@AfterEach
public void closeContext() {
void closeContext() {
this.context.close();
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -51,7 +51,7 @@ class MessageControllerWebTests {
private MockMvc mockMvc;
@BeforeEach
public void setup() {
void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
}

View File

@@ -51,7 +51,7 @@ class MessageControllerWebTests {
private MockMvc mockMvc;
@BeforeEach
public void setup() {
void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
}

View File

@@ -44,7 +44,7 @@ class SampleWsApplicationTests {
private int serverPort;
@BeforeEach
public void setUp() {
void setUp() {
this.webServiceTemplate.setDefaultUri("http://localhost:" + this.serverPort + "/services/");
}