-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[POC] Migrate JUnit
asserts to AssertJ
- impl
#2307
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,15 +22,14 @@ | |
import org.eclipse.aether.util.version.GenericVersionScheme; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class DefaultModelVersionParserTest { | ||
|
||
@Test | ||
void parseVersion() { | ||
Version v = new DefaultModelVersionParser(new GenericVersionScheme()).parseVersion(""); | ||
assertNotNull(v); | ||
assertEquals("", v.toString()); | ||
assertThat(v).isNotNull(); | ||
assertThat(v.toString()).isEqualTo(""); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If not, you can create custom assertions for AssertJ very easly. I do this quite a lot at work for custom objects/classes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be a bug, as failed to choose: https://docs.openrewrite.org/recipes/java/testing/assertj/simplifyassertjassertion Or simply need to chain. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any change not standardized is weakened. Simplest way would be or (continuous) migrate Both will cure generic |
||
} | ||
} |
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.
Aren't those messages automatically generated by assertJ in case of failures ?