-
Notifications
You must be signed in to change notification settings - Fork 39
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
AssertJ Refaster rules for Iterator#hasNext()
#1088
Comments
I suppose there would be a lot more interesting rules of this type that could be added. |
Adding these type of rules to |
In general this is a nice overview of recommended replacements for better assertions: On our side we're tackling these through But could be nice to have these covered with Refaster rules as well, for that early feedback. |
I forgot about this issue. Some of the rules mentioned here I added in #1479, but there's more to do, so will keep it open for now. |
I now also filed #1487. This still doesn't cover all of Sonar's S5838 rule, so will keep the issue open for a while longer. |
Running the
JUnitToAssertJRules
across some code I noticed thatAssertThatIsTrue
andAssertThatIsFalse
transformed some JUnitassertTrue()
andassertFalse()
calls:It seems like it would be a nice addition to have specific rules calling
AbstractIteratorAssert#hasNext()
andAbstractIteratorAssert#isExhausted()
instead.The example was found in hibernate/hibernate-tools: https://github.com/hibernate/hibernate-tools/blob/10431fc27866d295be9d2062ffdc9b1cd9099c16/jbt/src/test/java/org/hibernate/tool/orm/jbt/util/NativeConfigurationTest.java#L242-L247
The text was updated successfully, but these errors were encountered: