是否可以在Spring Boot产品代码中使用AssertJ?我设法在单元测试中使用它,但无法在src/main/java文件夹的java文件中解析'import static org.assertj.core.api.Assertions.*;‘,尽管我试图通过更改构建路径和更改junit的。或者在生产代码中使用AssertJ是一种糟糕的做法?
发布于 2021-11-01 09:12:12
AssertJ不是设计用在生产代码中的。在使用Spring Boot应用程序进行输入验证的情况下,Spring Framework的Assert、Apache Commons Lang的Validate或Google Guava的Preconditions可能是很好的选择。
https://stackoverflow.com/questions/69794092
复制相似问题