Add test coverage for Map-based multi-field sort#15691
Open
jamesfredley wants to merge 2 commits into
Open
Conversation
Adds OrderBySpec coverage for passing a Map to the sort argument, which exercises DynamicFinder.applySortForMap() through both list() and dynamic finders. This multi-field sort path (one direction per field) was documented in #15599 but had no test coverage. Assisted-by: claude-code:claude-4.8-opus
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Spock coverage for the previously-documented Map-based multi-field sort argument on GORM queries, ensuring DynamicFinder.applySortForMap() behavior is exercised via both list() and dynamic finder execution paths.
Changes:
- Adds a
list()test for multi-field Map sort with all ascending directions. - Adds a
list()test for multi-field Map sort with mixed (asc/desc) directions. - Adds a dynamic finder test that passes Map-based multi-field sort via finder arguments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ All tests passed ✅🏷️ Commit: ede2cef Learn more about TestLens at testlens.app. |
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
Adds test coverage for the Map-based multi-field
sortargument on GORM queries, exercisingDynamicFinder.applySortForMap()through bothlist()and dynamic finders.This path lets callers pass a
Mapof property to direction, e.g.query.list(sort: [firstName: "asc", lastName: "desc"]), producing multipleORDER BYclauses. It was documented in #15599 but had no test coverage, so this PR locks in the contract that was documented.Changes
OrderBySpec: three new feature methods coveringlist()list()Testing
All feature methods pass.
Follow-up to #15599 (review note about missing test coverage for the Map-sort path).