mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Polish "Deprecate TestRestTemplate"
See gh-46632
This commit is contained in:
@@ -52,7 +52,6 @@ dependencies {
|
||||
|
||||
testImplementation(project(":core:spring-boot-test"))
|
||||
testImplementation(project(":module:spring-boot-restclient"))
|
||||
testImplementation(project(":module:spring-boot-resttestclient"))
|
||||
testImplementation(project(":module:spring-boot-tomcat"))
|
||||
testImplementation(project(":test-support:spring-boot-test-support"))
|
||||
testImplementation(testFixtures(project(":module:spring-boot-actuator-autoconfigure")))
|
||||
|
||||
+1
-2
@@ -24,13 +24,12 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.restclient.RestTemplateBuilder;
|
||||
import org.springframework.boot.test.autoconfigure.json.AutoConfigureJson;
|
||||
import org.springframework.web.client.RestClient.Builder;
|
||||
|
||||
/**
|
||||
* Annotation that can be applied to a test class to enable auto-configuration of a
|
||||
* {@link Builder RestClient.Builder} and a {@link RestTemplateBuilder}.
|
||||
* {@link Builder RestClient.Builder}.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 4.0.0
|
||||
|
||||
+2
-2
@@ -90,10 +90,10 @@ import org.springframework.web.util.UriTemplateHandler;
|
||||
* @author Dmytro Nosan
|
||||
* @author Yanming Zhou
|
||||
* @since 4.0.0
|
||||
* @deprecated since 4.1.0 for removal in 4.3.0 in favor of
|
||||
* @deprecated since 4.2.0 for removal in 4.4.0 in favor of
|
||||
* {@link org.springframework.test.web.servlet.client.RestTestClient}
|
||||
*/
|
||||
@Deprecated(since = "4.1.0", forRemoval = true)
|
||||
@Deprecated(since = "4.2.0", forRemoval = true)
|
||||
@SuppressWarnings("removal")
|
||||
public class TestRestTemplate {
|
||||
|
||||
|
||||
+3
@@ -32,12 +32,15 @@ import org.springframework.boot.resttestclient.TestRestTemplate;
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 4.0.0
|
||||
* @deprecated since 4.2.0 for removal in 4.4.0 in favor of
|
||||
* {@link AutoConfigureRestTestClient}
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Inherited
|
||||
@ImportAutoConfiguration
|
||||
@Deprecated(since = "4.2.0", forRemoval = true)
|
||||
public @interface AutoConfigureTestRestTemplate {
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -31,8 +31,11 @@ import org.springframework.context.annotation.Bean;
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @see AutoConfigureTestRestTemplate
|
||||
* @deprecated since 4.2.0 for removal in 4.4.0 in favor of
|
||||
* {@link RestTestClientTestAutoConfiguration}
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@Deprecated(since = "4.2.0", forRemoval = true)
|
||||
@SuppressWarnings("removal")
|
||||
final class TestRestTemplateTestAutoConfiguration {
|
||||
|
||||
|
||||
+3
@@ -34,7 +34,10 @@ import java.net.URI
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 4.0.0
|
||||
* @deprecated since 4.2.0 for removal in 4.4.0 in favor of
|
||||
* {@link org.springframework.test.web.servlet.client.RestTestClient}
|
||||
*/
|
||||
@Deprecated(message = "in favor of RestTestClient", level = DeprecationLevel.ERROR)
|
||||
@Throws(RestClientException::class)
|
||||
inline fun <reified T : Any> TestRestTemplate.getForObject(url: String, vararg uriVariables: Any): T? =
|
||||
getForObject(url, T::class.java, *uriVariables)
|
||||
|
||||
+2
@@ -79,7 +79,9 @@ import static org.mockito.Mockito.mock;
|
||||
* @author Andy Wilkinson
|
||||
* @author Kristine Jetzke
|
||||
* @author Yanming Zhou
|
||||
* @deprecated since 4.2.0 for removal in 4.4.0
|
||||
*/
|
||||
@Deprecated(since = "4.2.0", forRemoval = true)
|
||||
@SuppressWarnings("removal")
|
||||
class TestRestTemplateTests {
|
||||
|
||||
|
||||
+2
@@ -34,7 +34,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Tests for {@link TestRestTemplateTestAutoConfiguration}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @deprecated since 4.2.0 for removal in 4.4.0
|
||||
*/
|
||||
@Deprecated(since = "4.2.0", forRemoval = true)
|
||||
@SuppressWarnings("removal")
|
||||
class TestRestTemplateTestAutoConfigurationTests {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user