Skip to content
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

Remove ExpectedException from internal test suite #2510

Closed
TimvdLippe opened this issue Dec 14, 2021 · 5 comments
Closed

Remove ExpectedException from internal test suite #2510

TimvdLippe opened this issue Dec 14, 2021 · 5 comments

Comments

@TimvdLippe
Copy link
Contributor

The rule is not ideal, as it will trigger even if the test fails for a completely different reason. Instead, we should use assertj with assertThatThrownBy to denote which specific line should trigger the exception.

@TimvdLippe
Copy link
Contributor Author

#2511 contains an example replacement. The expectation is that we do the same for all the other test suites we have lying around.

@temp-droid
Copy link
Contributor

Should we include the existing assertj assertThatThrownBy cases to make them consistent with the use of lambda instead of runnable?

@TimvdLippe
Copy link
Contributor Author

@temp-droid I don't think we need a dedication cleanup for that, but if you are changing a test that has runnables, then yes let's convert them to lambdas instead. Do you want to take on this task? Thanks in advance!

@temp-droid
Copy link
Contributor

temp-droid commented Dec 14, 2021

@TimvdLippe Do you want to remove @Test(expected = […].class) oriented tests too?

EDIT: just realized in the same file I'm looking into (MockInjectionUsingConstructorTest), we also have the classic try or fail catch assert type we could change.

@TimvdLippe
Copy link
Contributor Author

Yes to both of these, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants