是否可以在 Spring Boot 生產代碼中使用 AssertJ?我設法在單元測驗中使用它,但是'import static org.assertj.core.api.Assertions.*;' 無法在 src/main/java 檔案夾的 java 檔案中決議,即使我試圖通過更改構建路徑和更改 junit 的路徑來修復它。或者在生產代碼中使用 AssertJ 是一種不好的做法?
uj5u.com熱心網友回復:
AssertJ 不是為在生產代碼中使用而設計的。如果使用 Spring Boot 應用程式進行輸入驗證,Assert來自 Spring Framework、ValidateApache Commons Lang 或Preconditions來自 Google Guava 的輸入可能是不錯的選擇。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/344069.html
