Add specs for ClasspathEntityScanner and ReflectionUtils - #16188
Open
borinquenkid wants to merge 1 commit into
Open
Add specs for ClasspathEntityScanner and ReflectionUtils#16188borinquenkid wants to merge 1 commit into
borinquenkid wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: c87627e Learn more about TestLens at testlens.app/docs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ReflectionUtilsSpeccoveringisMethodOverriddenFromParent: 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.ClasspathEntityScannerSpecfrom a single happy-path test to coverjakarta.persistence.Entitydetection, 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).ReflectionUtils.isMethodOverriddenFromParent: drop a dead null check —Class#getMethodnever returns null, it throwsNoSuchMethodExceptioninstead.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