Another alternative is to use the documented JSON ...
# spring
l
Another alternative is to use the documented JSON assertions. https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#webtestclient-json
Copy code
client.post().uri("/person")
                .body(fromObject("""{ "name": "The Bride" }"""))
                .exchange()
                .expectHeader().contentType(MediaType.APPLICATION_JSON)
                .expectStatus().is2xxSuccessful
                .expectBody()
                .jsonPath("$['name']").isEqualTo(Person("The Bride"))