Add test coverage and clean up grails-datamapping-core validation package - #16189
Open
borinquenkid wants to merge 1 commit into
Open
Add test coverage and clean up grails-datamapping-core validation package#16189borinquenkid wants to merge 1 commit into
borinquenkid wants to merge 1 commit into
Conversation
…kage Adds Spock specs for classes in org.grails.datastore.gorm.validation that had no unit tests in their owning module (ConfigurableParameterNameProvider, ConstraintViolationUtils, GormValidatorFactoryAdapter, MethodKey, MappingContextAwareConstraintFactory, ValidatorRegistries, JakartaValidatorRegistry, ValidationEventListener). Also fixes several static-analysis findings surfaced while reviewing the package: an invalid generic cast and dead store in ValidationEventListener, a self-bounded generic misuse in JakartaValidatorRegistry, a raw Class[] usage and stale/incorrect comment in MethodKey, an unused constructor parameter in MethodValidationImplementer's weaveParameterNameData, and redundant def modifiers on explicitly-typed generic methods in GormValidatorAdapter/GormValidatorFactoryAdapter. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 8.1.x #16189 +/- ##
==================================================
+ Coverage 53.4149% 53.4734% +0.0585%
- Complexity 19459 19505 +46
==================================================
Files 2081 2081
Lines 98993 98995 +2
Branches 17361 17363 +2
==================================================
+ Hits 52877 52936 +59
+ Misses 38566 38520 -46
+ Partials 7550 7539 -11
🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: 9f78cbe 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
org.grails.datastore.gorm.validation(grails-datamapping-core) that had no unit tests in their owning module:ConfigurableParameterNameProvider,ConstraintViolationUtils,GormValidatorFactoryAdapter,MethodKey,MappingContextAwareConstraintFactory,ValidatorRegistries,JakartaValidatorRegistry, andValidationEventListener(previously only covered downstream ingrails-datamapping-rx).ValidationEventListener: invalid generic cast (Class<capture of ? extends GormValidateable>toClass<Object>) and a dead-storeboolean hasErrors = falseinitializer.JakartaValidatorRegistry: misuse of the self-boundedjakarta.validation.Configuration<T extends Configuration<T>>generic.MethodKey: rawClass[]usage and a stale/incorrect comment on theequals()implementation.MethodValidationImplementer: unused constructor parameter inweaveParameterNameData.GormValidatorAdapter/GormValidatorFactoryAdapter: redundantdefmodifiers on explicitly-typed generic methods.Test plan
./gradlew :grails-datamapping-core:test— full module suite passes./gradlew :grails-datamapping-core:codeStyle :grails-datamapping-core:codenarcMain— no violations🤖 Generated with Claude Code