Skip to content

WebTestClient cannot assert null list elements #36476

@bclozel

Description

@bclozel

With the current nullness information, Kotlin developers cannot test valid JSON responses like:

[null]

The following code snippet does not compile because expectBodyList expects a non nullable type.

webTestClient
		.get().uri("/")
		.exchange()
		.expectBodyList<String?>().contains(null)

This needs changes in the Kotlin extension function itself, but also will also require additional changes in Framework. This is similar to spring-projects/spring-graphql#1424

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions