对于mybatis-spring-boot-starter-test,我看不到任何主要方法,甚至没有Java文件。它有两个依赖关系,其中mybatis-spring-boot-test-autoconfigure包含一些测试文件,而当spring-boot-starter-test只有pom文件时,我可以执行它们。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-test-autoconfigure</artifactId>
</dependency>
那么如何执行这些测试模块呢?我不能,它是为什么创建的?
该模块不适用于“执行”。看看他们的文档:
什么是MyBatis-Spring-Boot-Starter-Test?
MyBatis-Spring-Boot-Starter-Test帮助使用MyBatis-Spring-Boot-Starter创建MyBatis组件的测试用例。
通过使用此模块,您将可以:
- 可以使用
@MybatisTest
安装测试组件来测试纯MyBatis组件- 可以导入依赖项工件以对纯MyBatis组件执行测试
因此,此模块为您提供@MybatisTest
了mybatis-spring-boot-test-autoconfigure
。基本上,这就是“启动器”:一组(可能是这种情况下的)依赖项,旨在一起提供一些功能。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句