-
Notifications
You must be signed in to change notification settings - Fork 181
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
Migrate tests to JUnit5 #324
Migrate tests to JUnit5 #324
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.
Hello @strangelookingnerd
I appreciate the intent of this PR but half of these changes are not required to port to JUnit 5 and I stopped reviewing after a while. You'll find some comments in the PR though.
Please be aware that in our post-XZ Utils world of supply chain attacks, a maintainer MUST review every single line of code, not just eyeball a file. A PR like one of 45 files and hundreds if not thousands of changes puts a painful burden on a maintainer like myself.
With this in mind, please:
- Only change what's required
- There is no need to edit every single test file to change the visibility of classes of methods.
- There is no need to edit JDBC implementations of methods to remove SQLExceptions from method signatures, this has nothing to do with JUnit 5.
Thank you again for your contribution and your time.
Please:
- Review my comments
- Review your own work, don't apply search and replace without examining the results, I think you would have caught the indentation issues.
- Provide the smallest PR that does the job
- Run 'mvn' (by itself) to run all build checks (the default Maven goal); running 'mvn clean verify' is not enough ;-)
TY !
src/test/java/org/apache/commons/dbutils/BasicRowProcessorTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/apache/commons/dbutils/handlers/ArrayHandlerTest.java
Outdated
Show resolved
Hide resolved
100% understand.
It's considered best practice for JUnit5 and I find it useful as it for example excludes those classes and methods from auto-completion and removes the burden to add Javadoc to them. As most IDEs / code analysis tools require Javadoc on /**
* Test the BasicRowProcessor class.
*/
public class BasicRowProcessorTest extends BaseTestCase { /**
* ColumnListHandlerTest
*/
public class ColumnListHandlerTest extends BaseTestCase { My proposal would be to follow the best practice of reducing the visibility of test classes and methods and remove superfluous Javadoc as well. WDYT? Totally fine if you disagree, just let me know.
Fair point, I put it under "trivial cleanup" since I was touching these methods anyway. I'll revert it.
I am mostly applying OpenRewrite recipes and validate / adapt the results manually. No clue how the indention got messed up here but I will re-check for sure. Maybe adding
In my defence, |
Hello @strangelookingnerd Thank you for the thoughtful reply. The README, CONTRIBUTING, and other files are generated when we create a release candidate. These files are out of date, so I'll offer my apologies for that. I just pushed re-generated versions of the README and CONTRIBUTING files. Let me offer you different POVs:
|
615697a
to
0d291a6
Compare
Reverted the changes as you requested and left the bare minumum in. |
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.
Hello @strangelookingnerd
Thank you for updating the PR. Everything looks good.
This PR aims to migrate all tests to JUnit5.
Migration includes:
Assertions
overAssert
public
modifiers from test classes and methodsexpected
andactual
, simplyifing assertions...)I validated my changes using
mvn verify
which passes just fine.