use actix_web::dev::{HttpServiceFactory, Service, ServiceResponse}; use actix_web::{App, test, web}; pub async fn test_app( app_state: web::Data, factory: F, ) -> impl Service where F: HttpServiceFactory + 'static, { test::init_service(App::new().app_data(app_state).service(factory)).await }