Skip to content

Fix ordering in test - #4255

Merged
ryanjbaxter merged 1 commit into
spring-cloud:mainfrom
ryanjbaxter:update-test-parameter-ordering
Aug 4, 2026
Merged

Fix ordering in test#4255
ryanjbaxter merged 1 commit into
spring-cloud:mainfrom
ryanjbaxter:update-test-parameter-ordering

Conversation

@ryanjbaxter

Copy link
Copy Markdown
Contributor

Caused by a change in Spring Framework spring-projects/spring-framework@b00f691

Previously Collectors.toSet() returned a HashSet, so the iteration order depended on 'String.hashCode()' for the keys in this test that happened to be 'quux, foo[], baz'. 'rewriteRequestParameter' removes and re-adds the rewritten parameter, moving foo[] to the end and yielding 'quux, baz, foo[]', which is what the assertion had hardcoded.

With 'LinkedHashSet', the order now follows 'getParameterMap()', which 'MockHttpServletRequest' backs with a 'LinkedHashMap' i.e. insertion order 'foo[], baz, quux', becoming 'baz, quux, foo[]' after the rewrite.

Caused by a change in Spring Framework spring-projects/spring-framework@b00f691
@ryanjbaxter ryanjbaxter added this to the 5.0.3 milestone Aug 4, 2026
@github-project-automation github-project-automation Bot moved this to Todo in 2025.1.3 Aug 4, 2026
@ryanjbaxter
ryanjbaxter merged commit 745b86d into spring-cloud:main Aug 4, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in 2025.1.3 Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants