-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce assertions for java.util.Optional
#1920
Comments
Interesting idea.
|
Yep, definitely. This would look like:
|
And there should be methods for OptionalLong, OptionalInt and OptionalDouble as well. |
To be perfectly honest, I'm not convinced that we should be adding additional categories of assertions to JUnit Jupiter. Third-party frameworks like AssertJ already provide excellent support for @junit-team/junit-lambda, thoughts? |
I agree. |
Convinced. |
Team Decision: we will not introduce dedicated assertions for Quoting from the User Guide:
|
java.util.Optional
It would be convenient to have some type safe shortcuts to test the content of an Optional for its presence and value. This has been discussed a few times like: https://stackoverflow.com/questions/38954742/assert-that-optional-has-certain-value
The following Assertions methods shall explain, what I have in mind:
The text was updated successfully, but these errors were encountered: