Retrieving the response body as a List of POJOs fails with RestClient
but passes with WebTestClient
#31574
Milestone
RestClient
but passes with WebTestClient
#31574
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 returns the response as a wrapped
List<Label>
. When I retrieve the response withWebTestClient
the list (correctly) containsLabel
instances, but when I retrieve the response withRestClient
the list containsMap
instances.In both cases, I've used the same
ParameterizedTypeReference
when retrieving the responseSteps to Reproduce
demo.zip
The application contains 2 integration tests, one of which invokes the endpoint with a
RestClient
and the other usesWebTestClient
. The latter test passes, but the former fails.The text was updated successfully, but these errors were encountered: