Expand description
Various helpers for Actix applications to use during testing.
§Creating A Test Service
§Off-The-Shelf Test Services
§Calling Test Service
TestRequest
call_service
try_call_service
call_and_read_body
call_and_read_body_json
try_call_and_read_body_json
§Reading Response Payloads
Re-exports§
pub use self::test_services::default_service;
Deprecatedpub use self::test_services::simple_service;
Deprecatedpub use self::test_utils::read_response;
Deprecatedpub use self::test_utils::read_response_json;
Deprecated
Structs§
- Async I/O test buffer.
- Test
Request
builder.
Functions§
- Helper function that returns a response body of a TestRequest
- Helper function that returns a deserialized response body of a TestRequest
- Calls service and waits for response future completion.
- Initialize service from application builder instance.
- Creates service that always responds with
200 OK
and no body. - Helper function that returns a response body of a ServiceResponse.
- Helper function that returns a deserialized response body of a ServiceResponse.
- Creates service that always responds with given status code and no body.
- Fallible version of
call_and_read_body_json
that allows testing service call errors. - Fallible version of
call_service
that allows testing response completion errors. - Fallible version of
read_body
that allows testing MessageBody reading errors. - Fallible version of
read_body_json
that allows testing response deserialization errors.