mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Fix WebTestClient list assertions
Prior to this commit, the `WebTestClient` could only accept non-nullable types in its `expectBodyList<T>` Kotlin extension function. This commit relaxes this requirements to allow for more assertions. Fixes gh-36476
This commit is contained in:
+2
-2
@@ -900,13 +900,13 @@ public interface WebTestClient {
|
||||
* List-specific assertions.
|
||||
* @param elementType the expected List element type
|
||||
*/
|
||||
<E> ListBodySpec<E> expectBodyList(Class<E> elementType);
|
||||
<E extends @Nullable Object> ListBodySpec<E> expectBodyList(Class<E> elementType);
|
||||
|
||||
/**
|
||||
* Alternative to {@link #expectBodyList(Class)} that accepts information
|
||||
* about a target type with generics.
|
||||
*/
|
||||
<E> ListBodySpec<E> expectBodyList(ParameterizedTypeReference<E> elementType);
|
||||
<E extends @Nullable Object> ListBodySpec<E> expectBodyList(ParameterizedTypeReference<E> elementType);
|
||||
|
||||
/**
|
||||
* Consume and decode the response body to {@code byte[]} and then apply
|
||||
|
||||
Reference in New Issue
Block a user