Deserializing a date fails with RestClient but passes with WebTestClient #31568
Labels
for: external-project
Needs a fix in external project
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
Affects: spring 6.1.0-RC2 with spring boot 3.2.0-RC2 and JDK21
Description
I've attached a sample Spring Boot application with a single endpoint that deserializes a date from the request data. The deserialization happens in the following lines of
DateDeserializerConfig
Steps to Reproduce
The application contains 2 integration tests, one of which invokes the endpoint with a
RestClient
and the other usesWebTestClient
. The same request data, headers, etc. are used in both cases.If the tests in
DemoApplicationTests
are run,testEndpointWithWebClient
passes, buttestEndpointWithRestClient
fails. The failure is caused byjsonParser.getValueAsString()
returning null when the latter test runs.If the date deserialization logic is removed, both tests pass.
demo.zip
The text was updated successfully, but these errors were encountered: