Skip to content

Add test coverage and clean up grails-datamapping-core validation package - #16189

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

Add test coverage and clean up grails-datamapping-core validation package#16189
borinquenkid wants to merge 1 commit into
8.1.xfrom
chore/datamapping-core-validation-cleanup

Conversation

@borinquenkid

Copy link
Copy Markdown
Member

Summary

  • Adds Spock specs for classes in org.grails.datastore.gorm.validation (grails-datamapping-core) that had no unit tests in their owning module: ConfigurableParameterNameProvider, ConstraintViolationUtils, GormValidatorFactoryAdapter, MethodKey, MappingContextAwareConstraintFactory, ValidatorRegistries, JakartaValidatorRegistry, and ValidationEventListener (previously only covered downstream in grails-datamapping-rx).
  • Fixes several static-analysis findings surfaced while reviewing the package:
    • ValidationEventListener: invalid generic cast (Class<capture of ? extends GormValidateable> to Class<Object>) and a dead-store boolean hasErrors = false initializer.
    • JakartaValidatorRegistry: misuse of the self-bounded jakarta.validation.Configuration<T extends Configuration<T>> generic.
    • MethodKey: raw Class[] usage and a stale/incorrect comment on the equals() implementation.
    • MethodValidationImplementer: unused constructor parameter in weaveParameterNameData.
    • GormValidatorAdapter / GormValidatorFactoryAdapter: redundant def modifiers on explicitly-typed generic methods.
  • No behavior changes; classes touched were already exercised through public APIs elsewhere and remain so (verified via full module test run).

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

…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>
Copilot AI lite review requested due to automatic review settings August 21, 2026 17:33

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

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 53.4734%. Comparing base (75cd618) to head (9f78cbe).

Files with missing lines Patch % Lines
...es/implementers/MethodValidationImplementer.groovy 75.0000% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                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     
Files with missing lines Coverage Δ
...orm/validation/jakarta/GormValidatorAdapter.groovy 88.8889% <ø> (ø)
...idation/jakarta/GormValidatorFactoryAdapter.groovy 100.0000% <ø> (+62.0690%) ⬆️
...validation/jakarta/JakartaValidatorRegistry.groovy 88.2353% <100.0000%> (+20.5882%) ⬆️
...s/datastore/gorm/validation/jakarta/MethodKey.java 75.0000% <100.0000%> (+8.3333%) ⬆️
...validation/listener/ValidationEventListener.groovy 95.6522% <100.0000%> (+21.7391%) ⬆️
...es/implementers/MethodValidationImplementer.groovy 83.3333% <75.0000%> (+0.4762%) ⬆️

... and 8 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: 9f78cbe
▶️ Tests: 63856 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