MockMvc和WebTestClient有什么区别? [英] What is the difference between MockMvc and WebTestClient?

查看:577
本文介绍了MockMvc和WebTestClient有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在Spring 4.x上进行测试时,我使用了MockMvc Web客户端, 但是我正在阅读并尝试使用Spring 5.x的新功能.

When I tried to test at Spring 4.x, I used MockMvc web client, but I am reading and trying new features of Spring 5.x.

我认为,WebTestClient和MockMvc是相同或非常相似的.

I think, WebTestClient and MockMvc are same or very similar.

MockMvc和WebTestClient有什么区别?

What is the difference between MockMvc and WebTestClient ?

我正在等待您的答复. 谢谢

I am waiting for your answer. Thank you

推荐答案

相似之处

  • 两者都提供了流利的样式的语法来测试Web服务.
  • 两者都可以或确实在绕过HTTP使用的模拟环境中运行.
  • Similarities

    • Both provide a fluent-style syntax for testing web services.
    • Both can or do operate in a simulated environment that bypasses the use of HTTP.
查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆