pub trait ApiResponse {
// Required methods
fn assert_json_api_resource(
&self,
kind: Option<&str>,
id: Option<&str>,
) -> &Self;
fn assert_json_api_collection(
&self,
kind: Option<&str>,
count: Option<usize>,
) -> &Self;
fn assert_api_error(&self, code: impl ExpectedError) -> &Self;
fn assert_idempotent_replay(&self) -> &Self;
fn assert_not_idempotent_replay(&self) -> &Self;
fn assert_deprecated(&self, sunset: Option<&str>) -> &Self;
fn assert_not_deprecated(&self) -> &Self;
fn assert_shape(&self, expected: Value) -> &Self;
}Expand description
Fusion Stack’s assertions on a test response. Each returns the response, so they chain.
Required Methods§
Sourcefn assert_json_api_resource(
&self,
kind: Option<&str>,
id: Option<&str>,
) -> &Self
fn assert_json_api_resource( &self, kind: Option<&str>, id: Option<&str>, ) -> &Self
A successful JSON:API document whose data is one resource, of kind and id when given.
Sourcefn assert_json_api_collection(
&self,
kind: Option<&str>,
count: Option<usize>,
) -> &Self
fn assert_json_api_collection( &self, kind: Option<&str>, count: Option<usize>, ) -> &Self
A successful JSON:API document whose data is a list of resources, each of kind and
count of them when given.
Sourcefn assert_api_error(&self, code: impl ExpectedError) -> &Self
fn assert_api_error(&self, code: impl ExpectedError) -> &Self
A JSON:API error document with an error of code. An ErrorCode also checks its status.
Sourcefn assert_idempotent_replay(&self) -> &Self
fn assert_idempotent_replay(&self) -> &Self
The response was replayed from an earlier request with the same Idempotency-Key.
Sourcefn assert_not_idempotent_replay(&self) -> &Self
fn assert_not_idempotent_replay(&self) -> &Self
The request ran: it was not replayed.
Sourcefn assert_deprecated(&self, sunset: Option<&str>) -> &Self
fn assert_deprecated(&self, sunset: Option<&str>) -> &Self
The version the response was served in is deprecated, sunsetting on sunset
(YYYY-MM-DD) when given.
Sourcefn assert_not_deprecated(&self) -> &Self
fn assert_not_deprecated(&self) -> &Self
The version the response was served in is not deprecated.
Sourcefn assert_shape(&self, expected: Value) -> &Self
fn assert_shape(&self, expected: Value) -> &Self
The body’s shape. Key order does not matter.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".