fn auth_mock<P>(client: &Client, method: &str, path: P) -> Mock
where
    P: Into<Matcher>,
{
    let guard = block_on(client.token.lock());
    let token = guard
        .as_ref()
        .expect("missing test client token")
        .token
        .clone();
    let bearer = format!("Bearer {}", token);

    mock(method, path).match_header("authorization", bearer.as_str())
}
/// HTTP mock with authorization header.
HTTP mock with authorization header.
HTTP mock with authorization header .
fn auth_mock<P>(client: &Client, method: &str, path: P) -> Mock
where
    P: Into<Matcher>,
{
    let guard = block_on(client.token.lock());
    let token = guard
        .as_ref()
        .expect("missing test client token")
        .token
        .clone();
    let bearer = format!("Bearer {}", token);
    mock(method, path).match_header("authorization", bearer.as_str())
}
fn auth_mock < P > ( client : & Client , method : & str , path : P ) -> Mock where P : Into < Matcher > , { let guard = block_on ( client . token . lock ( ) ) ; let token = guard . as_ref ( ) . expect ( " " ) . token . clone ( ) ; let bearer = format ! ( " " token ) ; mock ( method , path ) . match_header ( " " , bearer . as_str ( ) ) }
HTTP mock with authorization header.
HTTP mock with authorization header .
client
&Client
method
&str
path
P
client
&Client
method
&str
path
P