Skip to content

Commit

Permalink
Use Server::new_async
Browse files Browse the repository at this point in the history
  • Loading branch information
maoertel committed Apr 19, 2024
1 parent c946452 commit 19fbaae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- name: Install Clippy
run: rustup component add clippy
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
run: cargo clippy --all-targets --all-features -- -D warnings
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ url = "2.4"

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
mockito = "1.2"
mockito = "1.4"
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ mod tests {
#[tokio::test]
async fn given_non_digest_auth_endpoint_when_send_with_da_then_request_executed_normally() {
// Given I have a GET request against a non digest auth endpoint
let mut server = mockito::Server::new();
let mut server = mockito::Server::new_async().await;
let mock = server.mock("GET", PATH).with_status(200).create();
let request = create_request(&server);

Expand All @@ -164,7 +164,7 @@ mod tests {
#[tokio::test]
async fn given_non_digest_auth_endpoint_unauthorized_when_send_with_da_then_request_fails_with_401() {
// Given I have a GET request against a non digest auth but authorized endpoint
let mut server = mockito::Server::new();
let mut server = mockito::Server::new_async().await;
let mock = server.mock("GET", PATH).with_status(401).create();
let request = create_request(&server);

Expand All @@ -179,7 +179,7 @@ mod tests {
#[tokio::test]
async fn given_digest_auth_endpoint_authorized_when_send_with_da_then_request_succeeds() {
// Given I have a GET request against a digest auth endpoint with valid 'www-authenticate' header
let mut server = mockito::Server::new();
let mut server = mockito::Server::new_async().await;
let www_authenticate = "Digest realm=\"[email protected]\",qop=\"auth,auth-int\",nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\",opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"";
let mut header = HeaderMap::new();
header.insert("www-authenticate", HeaderValue::from_static(www_authenticate));
Expand Down

0 comments on commit 19fbaae

Please sign in to comment.