Interface RestTestClientResponse
- All Superinterfaces:
org.assertj.core.api.AssertProvider<RestTestClientResponseAssert>
public interface RestTestClientResponse
extends org.assertj.core.api.AssertProvider<RestTestClientResponseAssert>
AssertProvider for RestTestClientResponseAssert that holds the
result of an exchange performed through RestTestClient. Intended for
further use with AssertJ. For example:
ResponseSpec spec = restTestClient.get().uri("/greeting").exchange();
RestTestClientResponse response = RestTestClientResponse.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 RestTestClientResponsefrom(ExchangeResult result) Create an instance from anExchangeResult.static RestTestClientResponseCreate an instance from aRestTestClient.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 aRestTestClient.ResponseSpec. -
from
Create an instance from anExchangeResult.
-