-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Simplify assertions #3996
Simplify assertions #3996
Conversation
Using the appropriate assertion methods results in less and easier to read code as well as better error messages when assertions fail. Signed-off-by: Wouter Born <github@maindrain.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
@@ -76,6 +76,6 @@ public void testTokenNotExpiredEvenWithBuffer() { | |||
// token has a life time of 60 seconds | |||
token.setExpiresIn(60); | |||
|
|||
assertTrue(!token.isExpired(Instant.now(), 10), "Token should have been expired due to buffer"); | |||
assertFalse(token.isExpired(Instant.now(), 10), "Token should have been expired due to buffer"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the test and the message a contradiction? We test isExpired == false
and the failure message says the token should have expired?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the text. I think it was copied from testTokenExpiredDueToBuffer
to testTokenNotExpiredEvenWithBuffer
Signed-off-by: Wouter Born <github@maindrain.net>
Signed-off-by: Wouter Born <github@maindrain.net>
* Simplify assertions Using the appropriate assertion methods results in less and easier to read code as well as better error messages when assertions fail. Signed-off-by: Wouter Born <github@maindrain.net> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
Using the appropriate assertion methods results in less and easier to read code as well as better error messages when assertions fail.