From cbca065142781f47db827f24f94f9b4566094a19 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Fri, 17 Mar 2023 12:56:36 +0000 Subject: [PATCH] refactor: rename mod and function To follow production code conventions. --- tests/common/{tracker.rs => app.rs} | 2 +- tests/common/mod.rs | 2 +- tests/servers/api/test_environment.rs | 4 ++-- tests/servers/http/test_environment.rs | 4 ++-- tests/servers/udp/test_environment.rs | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) rename tests/common/{tracker.rs => app.rs} (72%) diff --git a/tests/common/tracker.rs b/tests/common/app.rs similarity index 72% rename from tests/common/tracker.rs rename to tests/common/app.rs index d9557370..132faeb0 100644 --- a/tests/common/tracker.rs +++ b/tests/common/app.rs @@ -4,7 +4,7 @@ use torrust_tracker::bootstrap; use torrust_tracker::tracker::services::tracker_factory; use torrust_tracker::tracker::Tracker; -pub fn new_tracker(configuration: Arc) -> Arc { +pub fn setup_with_config(configuration: Arc) -> Arc { bootstrap::app::initialize_static(); bootstrap::logging::setup(&configuration); diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 9452cc11..51a8a5b0 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,4 +1,4 @@ +pub mod app; pub mod fixtures; pub mod http; -pub mod tracker; pub mod udp; diff --git a/tests/servers/api/test_environment.rs b/tests/servers/api/test_environment.rs index c9b69332..be767f05 100644 --- a/tests/servers/api/test_environment.rs +++ b/tests/servers/api/test_environment.rs @@ -6,7 +6,7 @@ use torrust_tracker::tracker::peer::Peer; use torrust_tracker::tracker::Tracker; use super::connection_info::ConnectionInfo; -use crate::common::tracker::new_tracker; +use crate::common::app::setup_with_config; #[allow(clippy::module_name_repetitions, dead_code)] pub type StoppedTestEnvironment = TestEnvironment; @@ -39,7 +39,7 @@ impl TestEnvironment { pub fn new_stopped(cfg: torrust_tracker_configuration::Configuration) -> Self { let cfg = Arc::new(cfg); - let tracker = new_tracker(cfg.clone()); + let tracker = setup_with_config(cfg.clone()); let api_server = api_server(cfg.http_api.clone()); diff --git a/tests/servers/http/test_environment.rs b/tests/servers/http/test_environment.rs index e6013540..a1b3444d 100644 --- a/tests/servers/http/test_environment.rs +++ b/tests/servers/http/test_environment.rs @@ -5,7 +5,7 @@ use torrust_tracker::shared::bit_torrent::info_hash::InfoHash; use torrust_tracker::tracker::peer::Peer; use torrust_tracker::tracker::Tracker; -use crate::common::tracker::new_tracker; +use crate::common::app::setup_with_config; #[allow(clippy::module_name_repetitions, dead_code)] pub type StoppedTestEnvironment = TestEnvironment>; @@ -39,7 +39,7 @@ impl TestEnvironment> { pub fn new_stopped(cfg: torrust_tracker_configuration::Configuration) -> Self { let cfg = Arc::new(cfg); - let tracker = new_tracker(cfg.clone()); + let tracker = setup_with_config(cfg.clone()); let http_server = http_server(cfg.http_trackers[0].clone()); diff --git a/tests/servers/udp/test_environment.rs b/tests/servers/udp/test_environment.rs index c9f67c98..fdbb9036 100644 --- a/tests/servers/udp/test_environment.rs +++ b/tests/servers/udp/test_environment.rs @@ -6,7 +6,7 @@ use torrust_tracker::shared::bit_torrent::info_hash::InfoHash; use torrust_tracker::tracker::peer::Peer; use torrust_tracker::tracker::Tracker; -use crate::common::tracker::new_tracker; +use crate::common::app::setup_with_config; #[allow(clippy::module_name_repetitions, dead_code)] pub type StoppedTestEnvironment = TestEnvironment; @@ -41,7 +41,7 @@ impl TestEnvironment { pub fn new_stopped(cfg: torrust_tracker_configuration::Configuration) -> Self { let cfg = Arc::new(cfg); - let tracker = new_tracker(cfg.clone()); + let tracker = setup_with_config(cfg.clone()); let udp_server = udp_server(cfg.udp_trackers[0].clone());