Skip to content

Commit b343e73

Browse files
committed
Add streaming responses to Spring MVC Test section
Closes gh-22544
1 parent 620a898 commit b343e73

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/docs/asciidoc/testing.adoc

+14
Original file line numberDiff line numberDiff line change
@@ -5132,6 +5132,20 @@ instances, as the following example shows:
51325132
Registered filters are invoked through the `MockFilterChain` from `spring-test`, and the
51335133
last filter delegates to the `DispatcherServlet`.
51345134

5135+
5136+
[[spring-mvc-test-vs-streaming-response]]
5137+
===== Streaming Responses
5138+
5139+
There are no options built into Spring MVC Test for container-less testing of streaming
5140+
responses. Applications that make use of
5141+
<<web.adoc#mvc-ann-async-http-streaming,Spring MVC streaming>> options can use the
5142+
<<testing.adoc#webtestclient-stream,WebTestClient>> to perform end-to-end, integration
5143+
tests against a running server. This is also supported in Spring Boot where you can
5144+
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-testing-spring-boot-applications-testing-with-running-server[test a running server]
5145+
with `WebTestClient`. One extra advantage is the ability to use the `StepVerifier` from
5146+
project Reactor that allows declaring expectations on a stream of data.
5147+
5148+
51355149
[[spring-mvc-test-vs-end-to-end-integration-tests]]
51365150
===== Differences Between Out-of-Container and End-to-End Integration Tests
51375151

0 commit comments

Comments
 (0)