-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-19617 - [JDK17] Remove JUnit4 Dependency - HuaWeiCloud. #7871
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
Conversation
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.
Pull Request Overview
This PR modernizes the HuaWeiCloud module by removing the JUnit4 dependency and migrating to AssertJ for test assertions. This is part of a broader effort to remove JUnit4 dependencies in preparation for JDK17 compatibility.
- Replaces JUnit4's
Assume.assumeTrue()with AssertJ'sassumeThat()in test files - Removes JUnit4 dependency from pom.xml and adds AssertJ dependency
- Updates test assumption syntax to use fluent AssertJ API
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| TestOBSContractRename.java | Migrates test assumptions from JUnit4 to AssertJ |
| TestOBSContractCreate.java | Migrates test assumptions from JUnit4 to AssertJ |
| pom.xml | Removes JUnit4 dependency and adds AssertJ dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| public void testCreatedFileIsVisibleOnFlush() { | ||
| Assume.assumeTrue("unsupport", false); | ||
| assumeThat(false) | ||
| .as("unsupport.") |
Copilot
AI
Aug 14, 2025
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.
The error message contains a spelling error. 'unsupport' should be 'unsupported' to match standard English.
| public void testRenameFileUnderFile() { | ||
| Assume.assumeTrue("unsupport.", false); | ||
| assumeThat(false) | ||
| .as("unsupport.") |
Copilot
AI
Aug 14, 2025
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.
The error message contains a spelling error. 'unsupport' should be 'unsupported' to match standard English.
| public void testRenameFileUnderFile() { | ||
| Assume.assumeTrue("unsupport.", false); | ||
| assumeThat(false) | ||
| .as("unsupport.") |
Copilot
AI
Aug 14, 2025
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.
The error message contains a spelling error. 'unsupport' should be 'unsupported' to match standard English.
|
🎊 +1 overall
This message was automatically generated. |
|
@cnauroth Could you please review this PR? Thank you very much! |
zhtttylz
left a comment
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.
+1,LGTM @slfan1989
cnauroth
left a comment
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.
Should these tests use the JUnit5 @Disabled annotation instead of "assume false is true?"
@cnauroth Thank you for reviewing the code! Your suggestions are very reasonable, and I will optimize the code based on your feedback. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
cnauroth
left a comment
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.
Thanks for the update, @slfan1989 . I think the @Disabled annotation needs to go on just these individual test methods, not at class level. Otherwise, it will skip numerous other base class tests (which I assume are passing).
@cnauroth That’s a good suggestion, and I think it makes sense. I’ll keep working on improving this part of the code. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
8d518d8 to
cb8a795
Compare
|
🎊 +1 overall
This message was automatically generated. |
| </dependency> | ||
| <dependency> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-core</artifactId> |
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.
I think this dependency was used in the first version of the patch, but not in the current version. If so, can you please remove this dependency before committing?
Otheriwse, +1. Thanks @slfan1989 !
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.
@cnauroth Thank you for your suggestion! I agree with your point and will remove this dependency.
|
🎊 +1 overall
This message was automatically generated. |
cnauroth
left a comment
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.
+1. Thanks for incorporating all of the feedback, @slfan1989 !
@cnauroth Thanks for the review! |
Description of PR
JIRA: HADOOP-19617 - [JDK17] Remove JUnit4 Dependency - HuaWeiCloud.
How was this patch tested?
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?