2024-05-23 08:53:16 +01:00
|
|
|
//
|
|
|
|
#![cfg(not(tarpaulin_include))]
|
|
|
|
|
2024-05-25 11:25:13 +01:00
|
|
|
use derive_more::Constructor;
|
|
|
|
use git_next_config as config;
|
2024-05-23 16:19:28 +01:00
|
|
|
use git_next_git as git;
|
2024-05-11 19:46:20 +01:00
|
|
|
|
2024-05-25 11:25:13 +01:00
|
|
|
#[derive(Clone, Debug, Constructor)]
|
|
|
|
pub struct MockForge;
|
|
|
|
|
2024-04-16 22:21:55 +01:00
|
|
|
#[async_trait::async_trait]
|
2024-05-25 11:25:13 +01:00
|
|
|
impl git::ForgeLike for MockForge {
|
|
|
|
fn name(&self) -> String {
|
2024-04-16 22:21:55 +01:00
|
|
|
"mock".to_string()
|
|
|
|
}
|
|
|
|
|
2024-05-25 11:25:13 +01:00
|
|
|
fn is_message_authorised(
|
|
|
|
&self,
|
|
|
|
_msg: &config::WebhookMessage,
|
|
|
|
_expected: &config::WebhookAuth,
|
|
|
|
) -> bool {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parse_webhook_body(
|
|
|
|
&self,
|
|
|
|
_body: &config::webhook::message::Body,
|
|
|
|
) -> git::forge::webhook::Result<config::webhook::push::Push> {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn commit_status(&self, _commit: &git::Commit) -> git::forge::commit::Status {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn list_webhooks(
|
|
|
|
&self,
|
|
|
|
_webhook_url: &config::server::WebhookUrl,
|
|
|
|
) -> git::forge::webhook::Result<Vec<config::WebhookId>> {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn unregister_webhook(
|
|
|
|
&self,
|
|
|
|
_webhook_id: &config::WebhookId,
|
|
|
|
) -> git::forge::webhook::Result<()> {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn register_webhook(
|
|
|
|
&self,
|
|
|
|
_webhook_url: &config::server::WebhookUrl,
|
|
|
|
) -> git::forge::webhook::Result<config::RegisteredWebhook> {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|