-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Clean Unit test up (favor ExpectedException over try catch fail) #17
Clean Unit test up (favor ExpectedException over try catch fail) #17
Conversation
|
||
public class PrivateConstructionCheckerTest { | ||
@Rule public ExpectedException expectedException = ExpectedException.none(); |
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.
Good approach
LGTM @artem-zinnatullin PTAL, please |
expectedException.expectMessage("expectedTypeOfException can not be null"); | ||
PrivateConstructorChecker | ||
.forClass(Object.class) | ||
.expectedTypeOfException(null); |
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.
Can you please divide forClass
and expectedTypeOfException
, I mean, to make sure that it fails after call to the expectedTypeOfException
and not to the forClass
Sorry for tons of same comments, but they'll help during next iteration of code review |
Reordered ExpectedException to be closer to the origin
@artem-zinnatullin don't worry. You're right. I hope I got every place. |
👍 |
Clean Unit test up (favor ExpectedException over try catch fail)
@vanniktech thanks! |
No description provided.