Interface WebTestClientResponse

All Superinterfaces:
org.assertj.core.api.AssertProvider<WebTestClientResponseAssert>

public interface WebTestClientResponse extends org.assertj.core.api.AssertProvider<WebTestClientResponseAssert>
AssertProvider for WebTestClientResponseAssert that holds the result of an exchange performed through WebTestClient. Intended for further use with AssertJ. For example:
ResponseSpec spec = webTestClient.get().uri("/greeting").exchange();

WebTestClientResponse response = WebTestClientResponse.from(spec);
assertThat(response).hasStatusOk();
assertThat(response).contentType().isCompatibleWith(MediaType.APPLICATION_JSON);
assertThat(response).bodyJson().extractingPath("$.message").asString().isEqualTo("Hello World");
Since:
7.0
Author:
Rossen Stoyanchev