use std::sync::Arc; use async_trait::async_trait; use mockall::{mock, predicate::*}; use crate::email; mock! { pub EmailService {} #[async_trait] impl email::EmailServiceTrait for EmailService { async fn send_email(&self, email_sender: &str, email_receiver: &str, title: &str, message: &str) -> Result<(), email::Error>; } } // Default email service: will crash if `send_email` method is called. pub fn new_mock_email_service() -> Arc { Arc::new(MockEmailService::new()) }