Skip to content

Commit

Permalink
tests: add tests for layer and middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarisW committed Jul 30, 2024
1 parent 6fa85ac commit c60c170
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions volo-http/src/server/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,20 +523,12 @@ pub mod middleware_tests {
let route = Route::new(get_service(service_fn(service)));
let service = from_fn(converter).layer(route);

let resp = service
let _: Result<ServerResponse, Infallible> = service
.call(
&mut empty_cx(),
simple_req::<_, String>(Method::GET, "/", String::from("")),
simple_req(Method::GET, "/", String::from("")),
)
.await;
match resp {
Ok(resp) => {
let _: String = resp.into_string().await.unwrap();
}
Err(err) => {
let _: Infallible = err;
}
};
}

async fn index_handler() -> &'static str {
Expand Down

0 comments on commit c60c170

Please sign in to comment.