fix: 修复合并后的测试兼容性

- 更新 handler_test.rs 使用 RwLock<MockRouter>
- 确保所有 43 个测试通过

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-19 22:21:33 +08:00
parent 7d517a89c9
commit 24c4672022

View File

@@ -1,5 +1,5 @@
use std::collections::HashMap;
use std::sync::Arc;
use std::sync::{Arc, RwLock};
use axum::{
body::Body,
extract::Request,
@@ -42,7 +42,7 @@ fn create_app_state_with_rules(rules: Vec<&str>) -> Arc<AppState> {
}
let router = MockRouter::new(index);
Arc::new(AppState { router })
Arc::new(AppState { router: RwLock::new(router) })
}
#[test]