fix: update test cases to use mock

This commit is contained in:
GW_MC
2025-12-29 15:19:06 +08:00
parent 7ac3368715
commit 814f76291c

View File

@@ -80,6 +80,7 @@ pub async fn get_health_info(
mod test {
use crate::configs::FromConfig;
use crate::services::agent_client::AgentService;
use crate::services::get_app_service;
use crate::{
routes::{AppState, api::health::state::HealthState},
services::{
@@ -116,18 +117,10 @@ mod test {
let app_state = Arc::new(AppState {
database_connection: db.clone(),
config: Arc::new(crate::configs::ProgramSettings::mock()),
service: Arc::new(crate::routes::AppService {
settings: Arc::new(SettingsService::new(db.clone())),
auth_state: crate::routes::AuthState {
strategy: crate::routes::AuthStrategy {
password: Arc::new(PasswordStrategy::new(db.clone())),
},
authentication: Arc::new(AuthenticationServiceImpl::new(None)),
},
user: Arc::new(UserServiceImpl::new(db.clone())),
server_state: Arc::new(ServerStateService::new(db.clone())),
agent_client: Arc::new(AgentService::new(Configuration::default())),
}),
service: Arc::new(get_app_service(
&db.clone(),
&crate::configs::ProgramSettings::mock(),
)),
});
let app = Router::new()