“`”

<img alt=""img"" referrerpolicy=""no-referrer"" src=""//res.mianshigee.com/upload/article/20200111/1460000020092888.png"">

<pre><code>@WebMvcTest(value = ToTestController.class, secure = false):
</code></pre>

WebMvcTest** 注释用于 Spring MVC 程序的单元测试,其目标是专注于Spring MVC组件。在上面显示的快照中,我们只想启动 ToTestController。执行此单元测试时,将不会启动所有其他控制器和映射。

 

<pre><code> "“`

Was this helpful?

0 / 0

发表回复 0

Your email address will not be published.