-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Description
Bug in both spring boot 3.4.0-M1 and 3.3.2 (spring-test 6.2.0-M6 and 6.1.11).
When submitting a form in a real browser the query string is included in the parameters.
This allow me to write @PostMapping(params = "form=1") to detect which form was submitted.
It works in production, but not a unittest.
When using HtmlUnit in a test annotated with @SpringBootTest this fails.
HtmlUnitRequestBuilder.params reads this.webRequest.getParameters(), but WebRequest.getParameters ignores query string parameters for post.
I've tested this in spring boot 3.4.0-M1 as I hoped the switch to a newer htmlunit version would have fixed it.
The bug also exists in 3.3.2 and probably all previous versions.
I've put together a minimal testcase here: https://github.com/Crydust/testcasehtmlunit