feat(proxy): add render_config method and UpstreamService mock
- Add render_config to ProxyServiceTrait and implement it - Add mockall automock to UpstreamService - Remove unused OverrideRef import
This commit is contained in:
@@ -2,7 +2,7 @@ use sea_orm::{ActiveModelTrait, ActiveValue::Set, DatabaseConnection, EntityTrai
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::service::proxy::types::{
|
||||
OverrideRef, ProxyServiceError, ProxyServiceResult, UpstreamConfig,
|
||||
ProxyServiceError, ProxyServiceResult, UpstreamConfig,
|
||||
};
|
||||
|
||||
pub struct CreateUpstreamParams {
|
||||
@@ -34,6 +34,7 @@ fn model_to_config(model: crate::db::entities::upstream::Model) -> UpstreamConfi
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait UpstreamService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<UpstreamConfig>;
|
||||
|
||||
Reference in New Issue
Block a user