Skip to content

Commit 4badfd3

Browse files
committed
docs(test-utils): clarify redirect behavior for TestRestTemplate
1 parent 302a6e8 commit 4badfd3

File tree

1 file changed

+2
-1
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/test-utilities.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ It is recommended, but not mandatory, to use the Apache HTTP Client (version 5.1
5555
If you have that on your classpath, the javadoc:org.springframework.boot.test.web.client.TestRestTemplate[] responds by configuring the client appropriately.
5656
If you do use Apache's HTTP client, some additional test-friendly features are enabled:
5757

58-
* Redirects are not followed (so you can assert the response location).
5958
* Cookies are ignored (so the template is stateless).
6059

60+
By default, `TestRestTemplate` follows redirects in the same way as `RestTemplate`, regardless of which HTTP client implementation is used.
61+
6162
javadoc:org.springframework.boot.test.web.client.TestRestTemplate[] can be instantiated directly in your integration tests, as shown in the following example:
6263

6364
include-code::MyTests[]

0 commit comments

Comments
 (0)