Skip to content
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

Cleanup test classes #562

Merged
merged 3 commits into from
Jun 27, 2024
Merged

Cleanup test classes #562

merged 3 commits into from
Jun 27, 2024

Conversation

strangelookingnerd
Copy link
Contributor

Related: apache/httpcomponents-core#470

This PR cleans up the test classes. The proposed changes include:

Remove superfluous exceptions in throws clauses
Superfluous exceptions within throws clauses have negative effects on the readability and maintainability of the code.

Test classes and methods should have default package visibility
It is recommended to use the default package visibility to improve readability:

Test classes, test methods, and lifecycle methods are not required to be public, but they must not be private.
It is generally recommended to omit the public modifier for test classes, test methods, and lifecycle methods unless there is a technical reason for doing so – for example, when a test class is extended by a test class in another package. Another technical reason for making classes and methods public is to simplify testing on the module path when using the Java Module System.
— JUnit5 User Guide

Fix assertion argument orders
To me it seems like some assertions where not correctly upgraded when JUnit5 was introduced, where the order of arguments for some Assertions methods was changed.

@ok2c ok2c merged commit cc13243 into apache:master Jun 27, 2024
10 checks passed
@strangelookingnerd strangelookingnerd deleted the cleanup_tests branch June 28, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants