mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-25 19:09:03 +00:00
Replace TestRestTemplate with RestTestClient in integration tests
Before deprecating `TestRestTemplate`, we must first stop using it in integration tests and replace it with: * `RestTestClient` when the Spring MVC infrastructure is present * `RestClient` when the test does not have Spring MVC on classpath See gh-46632
This commit is contained in:
+1
@@ -49,6 +49,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@AutoConfigureWebTestClient
|
||||
@AutoConfigureTestRestTemplate
|
||||
@SuppressWarnings("removal")
|
||||
abstract class AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
+1
@@ -50,6 +50,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@AutoConfigureRestTestClient
|
||||
@AutoConfigureTestRestTemplate
|
||||
@SuppressWarnings("removal")
|
||||
abstract class AbstractSpringBootTestWebServerWebEnvironmentTests {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
Reference in New Issue
Block a user