willowtreeapps / assertk

assertions for kotlin inspired by assertj
MIT License
771 stars 87 forks source link

Added support to assert against Java's Optional data type. #372

Closed andriesfc closed 3 years ago

andriesfc commented 3 years ago

Java's Optional type is used to indicate that method either has result, or none.

A good example is a Spring Repository API which provides the following method:

Optional<T> findById(ID id)

This PR offers support for asserting against such an API.

evant commented 3 years ago

Added some minor changes to update error messages/docs and test to better match existing code, other than that looked good! 2f3a38f1417f7dc5a3c0b7c7aa565f6b184d57bd