File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ async fn test_bob_call_alice_webhook_accept() -> Result<()> {
7676 let alice_dialog_id = Arc :: new ( Mutex :: new ( None :: < String > ) ) ;
7777 let alice_dialog_id_clone = alice_dialog_id. clone ( ) ;
7878
79- let webhook_route = warp:: path ( "webhook" )
79+ let webhook_route = warp:: path ( String :: from ( "webhook" ) )
8080 . and ( warp:: post ( ) )
8181 . and ( warp:: header:: headers_cloned ( ) )
8282 . and ( warp:: body:: json ( ) )
@@ -103,18 +103,20 @@ async fn test_bob_call_alice_webhook_accept() -> Result<()> {
103103 }
104104
105105 info ! ( "Webhook received: {:?}" , body) ;
106- warp:: reply:: with_status ( "OK" , HttpStatusCode :: OK )
106+ warp:: reply:: with_status ( String :: from ( "OK" ) , HttpStatusCode :: OK )
107107 } ,
108108 ) ;
109109
110110 // Start webhook server
111111 let listener = TcpListener :: bind ( "127.0.0.1:0" ) . await ?;
112112 let webhook_addr = listener. local_addr ( ) ?;
113113 let webhook_url = format ! ( "http://127.0.0.1:{}/webhook" , webhook_addr. port( ) ) ;
114+ drop ( listener) ;
114115
115116 tokio:: spawn ( async move {
116117 warp:: serve ( webhook_route)
117- . incoming ( tokio_stream:: wrappers:: TcpListenerStream :: new ( listener) ) ;
118+ . run ( webhook_addr)
119+ . await ;
118120 } ) ;
119121
120122 // Wait for webhook server to start
You can’t perform that action at this time.
0 commit comments