采用
AssertJ是一个流畅的Java测试断言库,它提供了一组易于使用的断言方法,可以帮助你编写更具表现力的测试代码。
编写单元测试代码时,我基本上都是使用AssertJ,当然你可以选择更多的AssertJ Module,来满足你的需求。 常见的Module如下:
- JsonUnit: https://github.com/lukas-krecan/JsonUnit
- Guava: https://assertj.github.io/doc/#assertj-guava
- Joda Time: https://assertj.github.io/doc/#assertj-joda
- DB module: https://assertj.github.io/doc/#assertj-db
- assertk: assertions for kotlin inspired by assertj - https://github.com/willowtreeapps/assertk
References
- AssertJ: https://assertj.github.io/doc/