Skip to content

Replace "shameless coverage code" in SecurityNamespaceHandlerTests with meaningful tests #17689

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

Merged
merged 1 commit into from
Aug 15, 2025

Conversation

seongm1n
Copy link
Contributor

Removes "shameless class coverage stats boosting" code that created
meaningless anonymous class instances just to increase coverage metrics.

Replaces with proper tests that validate BeanIds and Elements constants
are accessible and not empty.

Changes:

  • Removed shameless coverage comment and anonymous class instantiations
  • Added meaningful constant validation tests
  • Improved test quality while maintaining coverage

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 12, 2025
@jzheaux jzheaux self-assigned this Aug 13, 2025
@jzheaux jzheaux added in: config An issue in spring-security-config type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 13, 2025
@jzheaux jzheaux changed the title Remove shameless coverage code from SecurityNamespaceHandlerTests Replace "shameless coverage code" in SecurityNamespaceHandlerTests with meaningful tests Aug 13, 2025
@jzheaux
Copy link
Contributor

jzheaux commented Aug 13, 2025

Thanks, @seongm1n! Will you please squash your commits and also update your commit title to be:

Replace "shameless coverage code" in SecurityNamespaceHandlerTests

The reason is that you are quoting something in the codebase. In this way, it's clear that no one is casting shade on someone else's code. Alternatively, you can say:

Provide Meaningful Testing for BeanIds, Elements, and SecurityNamespaceHandler

or similar.

@seongm1n
Copy link
Contributor Author

Thanks for the feedback! I've squashed the commits and updated the commit message as requested.

@jzheaux jzheaux merged commit 01401f1 into spring-projects:main Aug 15, 2025
6 checks passed
jzheaux added a commit that referenced this pull request Aug 15, 2025
@jzheaux
Copy link
Contributor

jzheaux commented Aug 15, 2025

Thanks for the PR, @seongm1n! I added a polish of my own in 890c11d to simplify the constructor logic and hopefully make the constructor test more informative.

@jzheaux jzheaux added this to the 7.0.0-M2 milestone Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants