Upgrade tests to Junit5

See gh-14737
This commit is contained in:
Madhura Bhave
2018-12-05 13:56:29 -08:00
parent 4c96c76f11
commit 59d2b0a3fb
804 changed files with 1976 additions and 2238 deletions

View File

@@ -15,13 +15,11 @@
*/
package sample.data.jdbc;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@@ -30,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Andy Wilkinson
*/
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureTestDatabase
public class CustomerRepositoryIntegrationTests {

View File

@@ -16,13 +16,11 @@
package sample.data.jdbc;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
@@ -37,7 +35,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*
* @author Andy Wilkinson
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class SampleDataJdbcApplicationTests {
@@ -46,7 +44,7 @@ public class SampleDataJdbcApplicationTests {
private MockMvc mvc;
@Before
@BeforeEach
public void setUp() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
}