From b1826267e94d08f03fea3060a67c926572eef761 Mon Sep 17 00:00:00 2001 From: furqan Date: Sat, 14 Jun 2025 14:08:50 +0530 Subject: [PATCH] docs(test-utils): clarify redirect behavior for TestRestTemplate Signed-off-by: furqan --- .../antora/modules/reference/pages/testing/test-utilities.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 8b8b8065aa04..b9c83dc65f0c 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 @@ -55,9 +55,10 @@ It is recommended, but not mandatory, to use the Apache HTTP Client (version 5.1 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). +By default, `TestRestTemplate` follows redirects in the same way as `RestTemplate`, regardless of which HTTP client implementation is used. + javadoc:org.springframework.boot.test.web.client.TestRestTemplate[] can be instantiated directly in your integration tests, as shown in the following example: include-code::MyTests[]