Migrates web examples to JUnit 5.

Original pull request #602
Related tickest #583
This commit is contained in:
divya_jnu08
2021-01-26 23:13:46 +05:30
committed by Jens Schauder
parent 64c1eeaf05
commit 9db9632c4b
7 changed files with 34 additions and 26 deletions

View File

@@ -16,12 +16,12 @@
package example.users;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.*;
import example.users.UserController.UserPayload;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@@ -37,7 +37,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.junit.jupiter.SpringExtension;
/**
* Integration tests for {@link UserController} to demonstrate client-side resilience of the payload type against
@@ -45,7 +45,7 @@ import org.springframework.test.context.junit4.SpringRunner;
*
* @author Oliver Gierke
*/
@RunWith(SpringRunner.class)
@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class UserControllerClientTests {