Skip to content

Commit 05a64ec

Browse files
committed
Merge branch '2.4.x'
Closes gh-26522
2 parents f7d2856 + 2a2c68f commit 05a64ec

File tree

2 files changed

+69
-97
lines changed
  • spring-boot-project

2 files changed

+69
-97
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc

+3-1
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,9 @@ include::{docs-java}/features/testing/utilities/outputcapture/MyOutputCaptureTes
929929
==== TestRestTemplate
930930
`TestRestTemplate` is a convenience alternative to Spring's `RestTemplate` that is useful in integration tests.
931931
You can get a vanilla template or one that sends Basic HTTP authentication (with a username and password).
932-
In either case, the template behaves in a test-friendly way by not throwing exceptions on server-side errors.
932+
In either case, the template is fault tolerant.
933+
This means that it behaves in a test-friendly way by not throwing exceptions on 4xx and 5xx errors.
934+
Instead, such errors can be detected via the returned `ResponseEntity` and its status code.
933935

934936
TIP: Spring Framework 5.0 provides a new `WebTestClient` that works for <<features#features.testing.spring-boot-applications.spring-webflux-tests, WebFlux integration tests>> and both <<features#features.testing.spring-boot-applications.with-running-server, WebFlux and MVC end-to-end testing>>.
935937
It provides a fluent API for assertions, unlike `TestRestTemplate`.

0 commit comments

Comments
 (0)