add 400+ unit tests for domain and application layers
Some checks failed
CI / Check / Test (push) Has been cancelled
Some checks failed
CI / Check / Test (push) Has been cancelled
Extract ReviewLogger trait to decouple import/integrations from diary::log_review (cross-module coupling smell). Add in-memory fakes for all repository ports, enabling isolated testing of every use case module without a database. Coverage: domain+application 22% → 80%, 427 tests.
This commit is contained in:
@@ -39,6 +39,17 @@ impl EventPublisher for NoopEventPublisher {
|
||||
}
|
||||
}
|
||||
|
||||
struct PanicReviewLogger;
|
||||
#[async_trait]
|
||||
impl application::ports::ReviewLogger for PanicReviewLogger {
|
||||
async fn log_review(
|
||||
&self,
|
||||
_: application::diary::commands::LogReviewCommand,
|
||||
) -> Result<(), DomainError> {
|
||||
panic!("review_logger not wired in tests")
|
||||
}
|
||||
}
|
||||
|
||||
struct PanicMeta;
|
||||
#[async_trait]
|
||||
impl MetadataClient for PanicMeta {
|
||||
@@ -450,6 +461,7 @@ async fn test_app() -> Router {
|
||||
event_publisher: Arc::new(NoopEventPublisher),
|
||||
diary_exporter: Arc::new(PanicExporter),
|
||||
document_parser: Arc::new(PanicDocumentParser),
|
||||
review_logger: Arc::new(PanicReviewLogger),
|
||||
},
|
||||
config: AppConfig {
|
||||
allow_registration: false,
|
||||
|
||||
Reference in New Issue
Block a user