@@ -325,16 +325,16 @@ mod tests {
325325 handle:: Handle ,
326326 tls_openssl:: { self , OpenSSLConfig } ,
327327 } ;
328- use axum:: { routing:: get, Router } ;
328+ use axum:: body:: Body ;
329+ use axum:: routing:: get;
330+ use axum:: Router ;
329331 use bytes:: Bytes ;
330332 use http:: { response, Request } ;
331- use hyper:: {
332- client:: conn:: { handshake, SendRequest } ,
333- Body ,
334- } ;
333+ use http_body_util:: BodyExt ;
334+ use hyper:: client:: conn:: http1:: { handshake, SendRequest } ;
335+ use hyper_util:: rt:: TokioIo ;
335336 use std:: { io, net:: SocketAddr , time:: Duration } ;
336337 use tokio:: { net:: TcpStream , task:: JoinHandle , time:: timeout} ;
337- use tower:: { Service , ServiceExt } ;
338338
339339 use openssl:: {
340340 ssl:: { Ssl , SslConnector , SslMethod , SslVerifyMode } ,
@@ -415,12 +415,7 @@ mod tests {
415415
416416 handle. shutdown ( ) ;
417417
418- let response_future_result = client
419- . ready ( )
420- . await
421- . unwrap ( )
422- . call ( Request :: new ( Body :: empty ( ) ) )
423- . await ;
418+ let response_future_result = client. send_request ( Request :: new ( Body :: empty ( ) ) ) . await ;
424419
425420 assert ! ( response_future_result. is_err( ) ) ;
426421
@@ -512,7 +507,7 @@ mod tests {
512507
513508 async fn connect ( addr : SocketAddr ) -> ( SendRequest < Body > , JoinHandle < ( ) > ) {
514509 let stream = TcpStream :: connect ( addr) . await . unwrap ( ) ;
515- let tls_stream = tls_connector ( dns_name ( ) , stream) . await ;
510+ let tls_stream = TokioIo :: new ( tls_connector ( dns_name ( ) , stream) . await ) ;
516511
517512 let ( send_request, connection) = handshake ( tls_stream) . await . unwrap ( ) ;
518513
@@ -525,14 +520,11 @@ mod tests {
525520
526521 async fn send_empty_request ( client : & mut SendRequest < Body > ) -> ( response:: Parts , Bytes ) {
527522 let ( parts, body) = client
528- . ready ( )
529- . await
530- . unwrap ( )
531- . call ( Request :: new ( Body :: empty ( ) ) )
523+ . send_request ( Request :: new ( Body :: empty ( ) ) )
532524 . await
533525 . unwrap ( )
534526 . into_parts ( ) ;
535- let body = hyper :: body:: to_bytes ( body ) . await . unwrap ( ) ;
527+ let body = body. collect ( ) . await . unwrap ( ) . to_bytes ( ) ;
536528
537529 ( parts, body)
538530 }
0 commit comments