Commit eec3eed5 authored by Stephane Nicoll's avatar Stephane Nicoll

Mention how to configure the web application type in tests

Closes gh-11025
parent 51de8ae6
......@@ -5990,6 +5990,23 @@ TIP: Do not forget to add `@RunWith(SpringRunner.class)` to your test. Otherwise
annotations are ignored.
==== Detecting Web Application Type
If Spring MVC is available, a regular MVC-based application context is configured. If you
have only Spring WebFlux, we'll detect that and configure a WebFlux-based application
context instead.
If both are present, Spring MVC takes precedence. If you want to test a reactive web
application in this scenario, you must set the `spring.main.web-application-type`
property:
[source,java,indent=0]
----
@RunWith(SpringRunner.class)
@SpringBootTest(properties = "spring.main.web-application-type=reactive")
public class MyWebFluxTests { ... }
----
[[boot-features-testing-spring-boot-applications-detecting-config]]
==== Detecting Test Configuration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment