[−][src]Struct bdrck::testing::http::TestStubClient
TestStubClient provides an HTTP-client-like interface for unit testing. Instead of interacting with real servers, it loads a previously recorded HTTP session and verifies application behavior against it.
Methods
impl TestStubClient
[src]
pub fn new() -> Self
[src]
Create a new, empty test stub client.
pub fn push_recording(&self, recording: &[u8]) -> Result<&Self>
[src]
Push the given recording (the serialized bytes) into this test stub.
Trait Implementations
impl AbstractClient for TestStubClient
[src]
fn execute(&self, request: Request) -> Result<(ResponseMetadata, Vec<u8>)>
[src]
fn get(&self, url: Url) -> RequestBuilder
[src]
fn post(&self, url: Url) -> RequestBuilder
[src]
fn put(&self, url: Url) -> RequestBuilder
[src]
fn patch(&self, url: Url) -> RequestBuilder
[src]
fn delete(&self, url: Url) -> RequestBuilder
[src]
fn head(&self, url: Url) -> RequestBuilder
[src]
fn sleep(&self, sleep: fn(_: Duration), duration: Duration)
[src]
fn execute_with_retries(
&self,
max_retries: usize,
add_jitter: bool,
method: Method,
url: Url,
headers: Option<&HeaderMap>,
body: Option<&[u8]>
) -> Result<(ResponseMetadata, Vec<u8>)>
[src]
&self,
max_retries: usize,
add_jitter: bool,
method: Method,
url: Url,
headers: Option<&HeaderMap>,
body: Option<&[u8]>
) -> Result<(ResponseMetadata, Vec<u8>)>
fn execute_with_retries_custom_sleep(
&self,
sleep: fn(_: Duration),
max_retries: usize,
add_jitter: bool,
method: Method,
url: Url,
headers: Option<&HeaderMap>,
body: Option<&[u8]>
) -> Result<(ResponseMetadata, Vec<u8>)>
[src]
&self,
sleep: fn(_: Duration),
max_retries: usize,
add_jitter: bool,
method: Method,
url: Url,
headers: Option<&HeaderMap>,
body: Option<&[u8]>
) -> Result<(ResponseMetadata, Vec<u8>)>
impl Drop for TestStubClient
[src]
Auto Trait Implementations
impl !RefUnwindSafe for TestStubClient
impl Send for TestStubClient
impl Sync for TestStubClient
impl Unpin for TestStubClient
impl !UnwindSafe for TestStubClient
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,