Add support for Mock test with WebFlux
This commit add mock support for WebFlux with an infrastructure similar to what `WebMvcTest` provides. `@WebFluxTest` can be used to test controllers with a narrowed classpath that is relevant to WebFlux. Also, `@SpringBootTest` now starts WebFlux in "mock" mode by default and `@AutoConfigureWebTestClient` can be used to inject a `WebTestClient` connected to the `ApplicationContext`. To make that happen, a `ReactiveWebApplicationContext` interface has been introduced to mirror what `WebApplicationContext` currently does. Things are still a bit volatile at this point and that infra may move to Spring Framework at some point. Closes gh-8401
This commit is contained in:
@@ -21,8 +21,8 @@ import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.ReactiveWebApplicationContext;
|
||||
import org.springframework.boot.context.embedded.LocalServerPort;
|
||||
import org.springframework.boot.context.embedded.ReactiveWebApplicationContext;
|
||||
import org.springframework.boot.context.embedded.ReactiveWebServerFactory;
|
||||
import org.springframework.boot.context.embedded.tomcat.TomcatReactiveWebServerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
Reference in New Issue
Block a user