diff --git a/Cargo.lock b/Cargo.lock index be718f93e..16f2d8fa2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4377,7 +4377,6 @@ dependencies = [ "futures", "hex", "hex-literal", - "hyper", "itertools 0.12.1", "nix", "opensearch", diff --git a/shotover-proxy/Cargo.toml b/shotover-proxy/Cargo.toml index 2cfbeda61..7aed9955f 100644 --- a/shotover-proxy/Cargo.toml +++ b/shotover-proxy/Cargo.toml @@ -54,7 +54,6 @@ cql-ws = { git = "https://github.com/shotover/cql-ws" } opensearch = "2.1.0" serde_json = "1.0.103" time = { version = "0.3.25" } -hyper.workspace = true shell-quote.workspace = true [features] diff --git a/shotover-proxy/tests/transforms/tee.rs b/shotover-proxy/tests/transforms/tee.rs index 5f3bcfa33..78d3b40e3 100644 --- a/shotover-proxy/tests/transforms/tee.rs +++ b/shotover-proxy/tests/transforms/tee.rs @@ -1,5 +1,4 @@ use crate::shotover_process; -use hyper::{body, Body, Client, Method, Request, Response}; use test_helpers::connection::redis_connection; use test_helpers::docker_compose::docker_compose; use test_helpers::shotover_process::{EventMatcher, Level}; @@ -205,23 +204,6 @@ async fn test_subchain_with_mismatch() { shotover.shutdown_and_then_consume_events(&[]).await; } -async fn read_response_body(res: Response) -> Result { - let bytes = body::to_bytes(res.into_body()).await?; - Ok(String::from_utf8(bytes.to_vec()).expect("response was not valid utf-8")) -} - -async fn hyper_request(uri: String, method: Method, body: Body) -> Response { - let client = Client::new(); - - let req = Request::builder() - .method(method) - .uri(uri) - .body(body) - .expect("request builder"); - - client.request(req).await.unwrap() -} - #[tokio::test(flavor = "multi_thread")] async fn test_switch_main_chain() { let shotover = shotover_process("tests/test-configs/tee/switch_chain.yaml") @@ -243,26 +225,11 @@ async fn test_switch_main_chain() { assert_eq!("a", result); - let _ = hyper_request( - format!( - "http://localhost:{}/transform/tee/result-source", - switch_port - ), - Method::PUT, - Body::from("tee-chain"), - ) - .await; + let url = format!("http://localhost:{switch_port}/transform/tee/result-source"); + let client = reqwest::Client::new(); + client.put(&url).body("tee-chain").send().await.unwrap(); - let res = hyper_request( - format!( - "http://localhost:{}/transform/tee/result-source", - switch_port - ), - Method::GET, - Body::empty(), - ) - .await; - let body = read_response_body(res).await.unwrap(); + let body = client.get(&url).send().await.unwrap().text().await.unwrap(); assert_eq!("tee-chain", body); let result = redis::cmd("SET") @@ -274,15 +241,7 @@ async fn test_switch_main_chain() { assert_eq!("b", result); - let _ = hyper_request( - format!( - "http://localhost:{}/transform/tee/result-source", - switch_port - ), - Method::PUT, - Body::from("regular-chain"), - ) - .await; + client.put(&url).body("regular-chain").send().await.unwrap(); let result = redis::cmd("SET") .arg("key")