Open
Description
Thanks for wiremock! It seems that it's currently not possible to execute async code in the respond method or respond trait. It'd be useful to have it natively supported by wiremock.
Wasn't able to find a workaround, tried
.respond_with(move |req: &Request| {
let handle = tokio::runtime::Handle::current();
std::thread::spawn(move || {
handle.block_on(async {
// Some async call
});
})
.join()
.unwrap();
ResponseTemplate::new(200)
})
but that's blocking the tokio runtime since the test runs as #[tokio::test]
.
Metadata
Metadata
Assignees
Labels
No labels