From 82bae34e5e36d994d3bf737d11651d93c6e65708 Mon Sep 17 00:00:00 2001 From: Naian <126972030+nain-F49FF806@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:01:56 +0100 Subject: [PATCH] refactor: remove unnecessary test connection is already tested in aries-connection test file Signed-off-by: Naian <126972030+nain-F49FF806@users.noreply.github.com> --- .../mediator/tests/mediator-coord-protocol.rs | 58 +------------------ 1 file changed, 3 insertions(+), 55 deletions(-) diff --git a/agents/rust/mediator/tests/mediator-coord-protocol.rs b/agents/rust/mediator/tests/mediator-coord-protocol.rs index ddaff4f459..868aad9941 100644 --- a/agents/rust/mediator/tests/mediator-coord-protocol.rs +++ b/agents/rust/mediator/tests/mediator-coord-protocol.rs @@ -1,21 +1,10 @@ mod common; -use std::collections::VecDeque; -use aries_vcx::protocols::connection::invitee::{states::completed::Completed, InviteeConnection}; use aries_vcx_core::wallet::base_wallet::BaseWallet; -use mediation::{ - didcomm_types::mediator_coord_structs::{ - KeylistData, KeylistQueryData, KeylistUpdateItem, KeylistUpdateItemAction, - KeylistUpdateRequestData, MediatorCoordMsgEnum, - }, - storage::MediatorPersistence, -}; -use mediator::aries_agent::{ - client::transports::{AriesReqwest, AriesTransport}, - Agent, +use mediation::didcomm_types::mediator_coord_structs::{ + KeylistData, KeylistQueryData, KeylistUpdateItem, KeylistUpdateItemAction, + KeylistUpdateRequestData, MediatorCoordMsgEnum, }; -use messages::msg_fields::protocols::out_of_band::invitation::Invitation as OOBInvitation; -use reqwest::header::ACCEPT; use crate::common::{ agent_and_transport_utils::{ @@ -27,47 +16,6 @@ use crate::common::{ static LOGGING_INIT: std::sync::Once = std::sync::Once::new(); -const ENDPOINT_ROOT: &str = "http://localhost:8005"; - -async fn didcomm_connection( - agent: &Agent, - aries_transport: &mut impl AriesTransport, -) -> Result> { - let client = reqwest::Client::new(); - let base: Url = ENDPOINT_ROOT.parse().unwrap(); - let endpoint_register = base.join("register").unwrap(); - - let oobi: OOBInvitation = client - .get(endpoint_register) - .header(ACCEPT, "application/json") - .send() - .await? - .error_for_status()? - .json() - .await?; - info!("Got invitation from register endpoint {:?}", oobi); - - let state: InviteeConnection = - agent.establish_connection(oobi, aries_transport).await?; - - Ok(state) -} - -#[tokio::test] -#[ignore] -async fn test_init() { - LOGGING_INIT.call_once(setup_env_logging); - let agent = mediator::aries_agent::AgentBuilder::new_demo_agent() - .await - .unwrap(); - let mut aries_transport = AriesReqwest { - response_queue: VecDeque::new(), - client: reqwest::Client::new(), - }; - let _ = didcomm_connection(&agent, &mut aries_transport).await; - let _ = didcomm_connection(&agent, &mut aries_transport).await; -} - #[tokio::test] async fn test_mediate_grant() -> Result<()> { LOGGING_INIT.call_once(setup_env_logging);