diff --git a/ntex/src/web/config.rs b/ntex/src/web/config.rs index 91c5034c..c7edceb6 100644 --- a/ntex/src/web/config.rs +++ b/ntex/src/web/config.rs @@ -68,7 +68,7 @@ pub struct ServiceConfig { } impl ServiceConfig { - pub(crate) fn new() -> Self { + pub fn new() -> Self { Self { services: Vec::new(), state: Extensions::new(), @@ -132,7 +132,7 @@ mod tests { use crate::http::{Method, StatusCode}; use crate::util::Bytes; use crate::web::test::{call_service, init_service, read_body, TestRequest}; - use crate::web::{self, App, HttpRequest, HttpResponse}; + use crate::web::{self, App, DefaultError, HttpRequest, HttpResponse}; #[crate::rt_test] async fn test_configure_state() { @@ -205,4 +205,11 @@ mod tests { let resp = call_service(&srv, req).await; assert_eq!(resp.status(), StatusCode::OK); } + + #[test] + fn test_new_service_config() { + let cfg: ServiceConfig = ServiceConfig::new(); + assert!(cfg.services.is_empty()); + assert!(cfg.external.is_empty()); + } }