测试
spring-test 模块提供了 ServerHttpRequest、ServerHttpResponse 和 ServerWebExchange 的模拟实现。
有关模拟对象的讨论,请参见 Spring Web Reactive。
WebTestClient 基于这些模拟请求和响应对象,为测试 WebFlux 应用程序(无需 HTTP 服务器)提供支持。你也可以使用 WebTestClient 进行端到端集成测试。
spring-test 模块提供了 ServerHttpRequest、ServerHttpResponse 和 ServerWebExchange 的模拟实现。
有关模拟对象的讨论,请参见 Spring Web Reactive。
WebTestClient 基于这些模拟请求和响应对象,为测试 WebFlux 应用程序(无需 HTTP 服务器)提供支持。你也可以使用 WebTestClient 进行端到端集成测试。