Testing
要测试使用 WebClient
的代码,可以像 OkHttp MockWebServer 一样使用模拟 Web 服务器。要查看其使用示例,请在 Spring Framework 测试套件中查看 WebClientIntegrationTests
或在 OkHttp 存储库中查看 static-server
示例。
To test code that uses the WebClient
, you can use a mock web server, such as the
OkHttp MockWebServer. To see an example
of its use, check out
WebClientIntegrationTests
in the Spring Framework test suite or the
static-server
sample in the OkHttp repository.