测试作用域依赖
原文:https://docs.spring.io/spring-boot/reference/testing/test-scope-dependencies.html (Spring Boot 4.2.0)
spring-boot-starter-test starter(在 test 作用域)包含以下提供的库:
- JUnit:Java 应用单元测试的事实标准。
- Spring Test 与 Spring Boot Test:Spring Boot 应用的实用工具和集成测试支持。
- AssertJ:流式断言库。
- Hamcrest:匹配器对象(也称为约束或谓词)库。
- Mockito:Java mock 框架。
- JSONassert:JSON 断言库。
- JsonPath:JSON 的 XPath。
- Awaitility:测试异步系统的库。
我们通常发现这些通用库在编写测试时很有用。如果这些库不适合你的需求,可以添加自己的额外测试依赖。