feat(proxy): add mockall automock to all proxy sub-services
This commit is contained in:
@@ -23,6 +23,7 @@ pub struct UpdateAccessRuleParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait AccessRuleService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<AccessRuleConfig>;
|
||||
|
||||
@@ -17,6 +17,7 @@ pub struct UpdateCacheZoneParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait CacheZoneService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<CacheZoneConfig>;
|
||||
|
||||
@@ -17,6 +17,7 @@ pub struct ConfigInheritanceRecord {
|
||||
pub applied_at: chrono::NaiveDateTime,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait ConfigInheritanceService: Send + Sync + 'static {
|
||||
async fn add(
|
||||
|
||||
@@ -19,6 +19,7 @@ pub struct UpdateLimitRuleParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait LimitRuleService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<LimitRuleConfig>;
|
||||
|
||||
@@ -17,6 +17,7 @@ pub struct UpdateLimitZoneParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait LimitZoneService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<LimitZoneConfig>;
|
||||
|
||||
@@ -21,6 +21,7 @@ pub struct UpdateLocationBlockParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait LocationBlockService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<LocationBlockConfig>;
|
||||
|
||||
@@ -19,6 +19,7 @@ pub struct UpdateLogSettingParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait LogSettingService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<LogSettingConfig>;
|
||||
|
||||
@@ -23,6 +23,7 @@ pub struct UpdateProxySettingParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait ProxySettingService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<ProxySettingConfig>;
|
||||
|
||||
@@ -21,6 +21,7 @@ pub struct UpdateRewriteRuleParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait RewriteRuleService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<RewriteRuleConfig>;
|
||||
|
||||
@@ -22,6 +22,7 @@ pub struct UpdateServerBlockParams {
|
||||
pub override_of_id: Option<Option<Uuid>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait ServerBlockService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<ServerBlockConfig>;
|
||||
|
||||
@@ -18,6 +18,7 @@ pub struct UpdateSslCertificateParams {
|
||||
pub expiry_date: Option<chrono::DateTime<Utc>>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, mockall::automock)]
|
||||
#[async_trait::async_trait]
|
||||
pub trait SslCertificateService: Send + Sync + 'static {
|
||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<SslCertificateConfig>;
|
||||
|
||||
Reference in New Issue
Block a user