From 82f9491a74da64bb5a48ea3caaf2e462adacdc01 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 17 Jun 2025 19:30:16 +0100 Subject: [PATCH] Improve description of TestRestTemplate's Apache client defaults Closes gh-45842 --- .../modules/reference/pages/testing/test-utilities.adoc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/test-utilities.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/test-utilities.adoc index 8b8b8065aa0..7965a8d6d7a 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/test-utilities.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/test-utilities.adoc @@ -53,10 +53,7 @@ It provides a fluent API for assertions, unlike javadoc:org.springframework.boot It is recommended, but not mandatory, to use the Apache HTTP Client (version 5.1 or better). If you have that on your classpath, the javadoc:org.springframework.boot.test.web.client.TestRestTemplate[] responds by configuring the client appropriately. -If you do use Apache's HTTP client, some additional test-friendly features are enabled: - -* Redirects are not followed (so you can assert the response location). -* Cookies are ignored (so the template is stateless). +If you do use Apache's HTTP client it is configured to ignore cookies (so the template is stateless). javadoc:org.springframework.boot.test.web.client.TestRestTemplate[] can be instantiated directly in your integration tests, as shown in the following example: