SpringBoot测试之SpringBootTest和WebM

2022-06-20  本文已影响0人  刘晓佳rachel

@SpringBootTest注释告诉Spring Boot去寻找一个主配置类(例如一个带@SpringBootApplication),并使用它来启动Spring应用程序上下文。SpringBootTest加载完整的应用程序并注入所有可能很慢的bean。

@WebMvcTest - 用于测试控制器层,您需要使用模拟对象提供所需的剩余依赖项。

转发自:https://blog.csdn.net/z69183787/article/details/108077405

上一篇 下一篇

猜你喜欢

热点阅读