Skip to content

Commit b1ef4db

Browse files
authored
Merge pull request #16 from yeoleobun/patch3
Fix: broken test test_bob_call_alice_webhook_accept
2 parents 604d661 + 7d7d173 commit b1ef4db

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/useragent/tests/test_invitation.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)