Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在使用 Spring Boot 时,Spring Rest 文档 (spring-restdocs) 是 Swagger 的一个很好的替代品。将集成测试与 Rest 文档测试混合在一起,还是创建单独的 Rest 文档测试更好,即使某些测试是重复的?
如果这主要是基于意见的,我不会感到惊讶。也就是说,我认为可以将事情分开。
用于文档的测试和您的其他测试在本质上是完全不同的。一般来说,您只会对通过 API 记录黄金路径感兴趣,而不希望为(许多)错误或处理极端输入生成文档。
将测试分开有助于加强这种目的差异,并更容易快速确定测试应该做什么:记录 API 或验证其功能。