feature/upstream-service #13

Merged
GW_MC merged 43 commits from feature/upstream-service into master 2026-01-01 10:49:32 +08:00
2 changed files with 9 additions and 10 deletions
Showing only changes of commit 9c3f775a67 - Show all commits

View File

@@ -12,10 +12,6 @@ macro_rules! with_conn {
}};
}
pub struct Filters {
pub pagination: Option<PaginationFilter>,
}
pub struct PaginationFilter {
pub page: u64,
pub per_page: u64,

View File

@@ -138,7 +138,7 @@ mod tests {
create_upstream::{CreateUpstreamRequestBody, UpstreamTargetInfo as ReqTarget},
get_upstream_router,
},
services::{agent_client::MockAgentService, get_app_service, get_mock_app_service},
services::{agent_client::MockAgentService, get_mock_app_service},
};
fn get_router_with_state(db: DatabaseConnection) -> axum::Router {
@@ -271,10 +271,12 @@ mod tests {
let mut mock = MockAgentService::new();
mock.expect_validate().returning(|_cfg| Ok(()));
mock.expect_apply().returning(|_cfg| {
Err(crate::services::agent_client::AgentError::ApplicationFailed(
"internal".to_string(),
"Failed to communicate with the agent.".to_string(),
))
Err(
crate::services::agent_client::AgentError::ApplicationFailed(
"internal".to_string(),
"Failed to communicate with the agent.".to_string(),
),
)
});
let mock_agent = Arc::new(mock);
@@ -285,7 +287,8 @@ mod tests {
.into_connection();
let program_settings = ProgramSettings::mock();
let app_service = get_mock_app_service(&Arc::new(db.clone()), &program_settings, mock_agent);
let app_service =
get_mock_app_service(&Arc::new(db.clone()), &program_settings, mock_agent);
let state = Arc::new(crate::routes::AppState {
database_connection: Arc::new(db),
service: Arc::new(app_service),