When using RestClient
it's possible to submit a request that's expected to succeed via
restClient.post()
.uri("/foo/bar")
.body(requestData)
.retrieve();
With a RestTestClient
the equivalent is
restTestClient.post()
.uri("/foo/bar")
.body(requestData)
.exchange()
.expectStatus().is2xxSuccessful();
Could we add a retrieve()
method to the RestTestClient
API? Not only would it make the code a bit more concise for the very common case of submitting a request that's expected to succeed, but it would ease migrating from RestClient
to RestTestClient
.