Add test coverage for grails-datamapping-async and type decorator closures - #16193
Open
borinquenkid wants to merge 2 commits into
Open
Add test coverage for grails-datamapping-async and type decorator closures#16193borinquenkid wants to merge 2 commits into
borinquenkid wants to merge 2 commits into
Conversation
…sures The module had no test infrastructure at all, so add the Spock dependency and specs for GormAsyncStaticApi and AsyncQuery covering task()/list()/ count() delegation and the new-session decorator wrapping. AsyncQuery was previously untested anywhere in the repo. Also give both classes' promise decorator closures explicit parameter types (Closure<?> callable, Object[] args) instead of relying on implicit inference, fixing an IDE "cannot infer argument types" inspection on the generic PromiseDecorator SAM coercion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.1.x #16193 +/- ##
==================================================
+ Coverage 53.4149% 53.4331% +0.0182%
- Complexity 19459 19467 +8
==================================================
Files 2081 2081
Lines 98993 98993
Branches 17361 17361
==================================================
+ Hits 52877 52895 +18
+ Misses 38566 38550 -16
+ Partials 7550 7548 -2
🚀 New features to boost your workflow:
|
The trait's static getAsync() had no direct test and is excluded from JaCoCo (its @generated annotation skips instrumentation), so nothing flagged it as untested. Verify it wraps the entity's own registered GormStaticApi in a GormAsyncStaticApi and that task() runs through that API's session, not some other entity's.
✅ All tests passed ✅🏷️ Commit: 3e29c85 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
grails-datamapping-asynchad no test infrastructure at all (nosrc/test, no Spock dependency). AddedtestImplementation 'org.spockframework:spock-core'andtestRuntimeOnly 'org.slf4j:slf4j-nop'.GormAsyncStaticApiSpecandAsyncQuerySpec, coveringtask()/list()/count()delegation through the@DelegateAsync-generated methods and thegetDecorators()new-session wrapping.AsyncQuerywas previously untested anywhere in the repo (its only sibling,GormAsyncStaticApi, was exercised indirectly via a TCK spec in a different module,grails-datamapping-core-test).PromiseDecoratorclosures explicit parameter types (Closure<?> callable,Object[] args) instead of relying on implicit inference, fixing an IDE "cannot infer argument types" inspection on the generic SAM coercion. No behavior change.Test plan
./gradlew :grails-datamapping-async:test- all 8 specs pass./gradlew :grails-datamapping-async:codeStyle- clean🤖 Generated with Claude Code