美文网首页
SpringBoot测试之SpringBootTest和WebM

SpringBoot测试之SpringBootTest和WebM

作者: 刘晓佳rachel | 来源:发表于2022-06-20 15:11 被阅读0次

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

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

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

    相关文章

      网友评论

          本文标题:SpringBoot测试之SpringBootTest和WebM

          本文链接:https://www.haomeiwen.com/subject/fbdjvrtx.html