-
Notifications
You must be signed in to change notification settings - Fork 38.5k
HeaderResultMatchers should not import org.junit.Assert #22932
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
Comments
Seems reasonable outside of spring-test. |
I agree. I'll fix the import and implement As for the checkstyle rule only applied to |
Reopening for the potential inclusion of a Checkstyle rule to prevent this in the future. |
You're right that we cannot disallow the use of JUnit in general in |
Recently I've seen code like So I've also been considering introducing a Checkstyle rule that forbids non-static imports of @philwebb would you like to tackle that one, too? |
Never mind: I'm tackling that one on my own. |
This commit configures Checkstyle to enforces static imports for JUnit 4 assertions and assumptions. See spring-projectsgh-22932
Actually, now that I think about it... it shouldn't be possible for any project other than |
Closing this issue since the new Checkstyle rules will be addressed in #22962. |
It looks like
HeaderResultMatchers
is accidentally importingorg.junit.Assert.assertNotNull
rather than our ownorg.springframework.test.util.AssertionErrors
.I wonder if we can put a checkstyle rule to prevent junit imports in src/main
The text was updated successfully, but these errors were encountered: