Skip to content

Add specs for ClasspathEntityScanner and ReflectionUtils - #16188

Open
borinquenkid wants to merge 1 commit into
8.1.xfrom
test/datamapping-core-utils-cleanup
Open

Add specs for ClasspathEntityScanner and ReflectionUtils#16188
borinquenkid wants to merge 1 commit into
8.1.xfrom
test/datamapping-core-utils-cleanup

Conversation

@borinquenkid

Copy link
Copy Markdown
Member

Summary

  • Add ReflectionUtilsSpec covering isMethodOverriddenFromParent: a genuinely overridden public method, a method unique to the subclass, a method whose declaring class has no superclass (e.g. Object), and a package-private method that only shadows a same-named parent method.
  • Expand ClasspathEntityScannerSpec from a single happy-path test to cover jakarta.persistence.Entity detection, non-entity classes being excluded, empty package input, de-duplication across a repeated package, combining results across multiple packages, and the previously-untested "ignored package" branch (com, org, etc. are skipped rather than scanned).
  • Minor cleanup in ReflectionUtils.isMethodOverriddenFromParent: drop a dead null check — Class#getMethod never returns null, it throws NoSuchMethodException instead.

Test plan

  • ./gradlew :grails-datamapping-core:test --tests "org.grails.datastore.gorm.utils.ClasspathEntityScannerSpec" --tests "org.grails.datastore.gorm.utils.ReflectionUtilsSpec"
  • ./gradlew :grails-datamapping-core:test :grails-datamapping-core:codenarcMain :grails-datamapping-core:codenarcTest

Copilot AI lite review requested due to automatic review settings August 21, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@borinquenkid borinquenkid moved this to In Progress in Apache Grails Aug 21, 2026
@borinquenkid borinquenkid added this to the grails:8.1.0-M1 milestone Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.4311%. Comparing base (75cd618) to head (c87627e).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.1.x     #16188        +/-   ##
==================================================
+ Coverage     53.4149%   53.4311%   +0.0162%     
- Complexity      19459      19466         +7     
==================================================
  Files            2081       2081                
  Lines           98993      98991         -2     
  Branches        17361      17360         -1     
==================================================
+ Hits            52877      52892        +15     
+ Misses          38566      38552        -14     
+ Partials         7550       7547         -3     
Files with missing lines Coverage Δ
...g/grails/datastore/gorm/utils/ReflectionUtils.java 87.5000% <100.0000%> (+87.5000%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app

testlens-app Bot commented Aug 21, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: c87627e
▶️ Tests: 63321 executed
⚪️ Checks: 77/77 completed


Learn more about TestLens at testlens.app/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants