From d933ffe17e5059f9a3191d82524dd11a39919cd8 Mon Sep 17 00:00:00 2001 From: Samuel Gomez Date: Mon, 22 Apr 2024 17:19:33 +0100 Subject: [PATCH] Removing admin route test --- api/tests/api_tests/auth_tests.rs | 62 +------------------------- api/tests/api_tests/test_server/mod.rs | 9 ---- 2 files changed, 1 insertion(+), 70 deletions(-) diff --git a/api/tests/api_tests/auth_tests.rs b/api/tests/api_tests/auth_tests.rs index b8182d36..7c5086bf 100644 --- a/api/tests/api_tests/auth_tests.rs +++ b/api/tests/api_tests/auth_tests.rs @@ -6,7 +6,7 @@ use http::{ }; use serde_json::{json, Value}; -use super::test_server::{ApiResponse, TestServer, AUTH_PATHS, PUBLIC_PATHS}; +use super::test_server::{ApiResponse, TestServer, PUBLIC_PATHS}; #[tokio::test] async fn test_root() { @@ -19,66 +19,6 @@ async fn test_root() { assert_eq!(res.code, StatusCode::OK); } -#[tokio::test] -async fn test_authorized() { - let server = TestServer::new(false, None).await; - - for path in AUTH_PATHS { - let res = server - .send_request::(&format!("v1/{path}"), Method::GET, None, None) - .await - .unwrap(); - assert_eq!( - res, - ApiResponse { - code: StatusCode::UNAUTHORIZED, - data: json!({"error": "Unauthorized"}) - } - ); - - let res = server - .send_request::( - &format!("v1/{path}"), - Method::GET, - Some("invalid_access_key"), - None, - ) - .await - .unwrap(); - assert_eq!( - res, - ApiResponse { - code: StatusCode::UNAUTHORIZED, - data: json!({"error": "Unauthorized"}) - } - ); - - let res = server - .send_request::( - &format!("v1/{path}"), - Method::GET, - Some(&server.live_key), - None, - ) - .await - .unwrap(); - - assert_eq!(res.code, StatusCode::OK); - - let res = server - .send_request::( - &format!("v1/{path}"), - Method::GET, - Some(&server.test_key), - None, - ) - .await - .unwrap(); - - assert_eq!(res.code, StatusCode::OK); - } -} - #[tokio::test] async fn test_unauthorized() { let server = TestServer::new(false, None).await; diff --git a/api/tests/api_tests/test_server/mod.rs b/api/tests/api_tests/test_server/mod.rs index 893732d7..d62a3c0d 100644 --- a/api/tests/api_tests/test_server/mod.rs +++ b/api/tests/api_tests/test_server/mod.rs @@ -60,15 +60,6 @@ pub mod test_core; #[cfg(test)] pub mod test_gateway; -#[allow(dead_code)] -pub const AUTH_PATHS: &[&str] = &[ - "pipelines", - "events", - "transactions", - "connections", - "event-access", -]; - #[allow(dead_code)] pub const PUBLIC_PATHS: &[&str] = &["connection-definitions", "openapi"];