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
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebTestClientResponsefrom(ExchangeResult result) Create an instance from anExchangeResult.static WebTestClientResponseCreate an instance from aWebTestClient.ResponseSpec.Return the underlyingExchangeResult.Methods inherited from interface org.assertj.core.api.AssertProvider
assertThat
-
Method Details
-
getExchangeResult
ExchangeResult getExchangeResult()Return the underlyingExchangeResult. -
from
Create an instance from aWebTestClient.ResponseSpec. -
from
Create an instance from anExchangeResult.
-