Skip to content

Commit

Permalink
use non blocking reqwest
Browse files Browse the repository at this point in the history
Signed-off-by: George Mulhearn <gmulhearn@anonyome.com>
  • Loading branch information
gmulhearn-anonyome committed Jul 23, 2024
1 parent 98ab1da commit 9f4ccd5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions aries/agents/mediator/tests/mediator-readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@ static LOGGING_INIT: std::sync::Once = std::sync::Once::new();

const ENDPOINT_ROOT: &str = "http://localhost:8005";

#[test]
fn base_path_returns_readme() -> Result<()> {
#[tokio::test]
async fn base_path_returns_readme() -> Result<()> {
LOGGING_INIT.call_once(setup_env_logging);

let client = reqwest::blocking::Client::new();
let client = reqwest::Client::new();
let endpoint: Url = ENDPOINT_ROOT.parse().unwrap();

let res = client
.get(endpoint)
.header(ACCEPT, "application/json")
.send()?
.send()
.await?
.error_for_status()?;
info!("{:?}", res);

let _: ReadmeInfo = res.json()?;
let _: ReadmeInfo = res.json().await?;

Ok(())
}

0 comments on commit 9f4ccd5

Please sign in to comment.