test: refusing fakes, failure-path tests, shared panic stubs
This commit is contained in:
@@ -4,8 +4,9 @@ use async_trait::async_trait;
|
||||
|
||||
use crate::{
|
||||
errors::DomainError,
|
||||
events::DomainEvent,
|
||||
ports::{EventPublisher, ObjectStorage},
|
||||
events::{AckHandle, DomainEvent},
|
||||
models::{Person, PersonEnrichmentData, PersonId},
|
||||
ports::{EventPublisher, ObjectStorage, PersonCommand},
|
||||
value_objects::UserId,
|
||||
};
|
||||
|
||||
@@ -145,3 +146,38 @@ impl crate::ports::RemoteGoalRepository for NoopRemoteGoalRepository {
|
||||
Ok(vec![])
|
||||
}
|
||||
}
|
||||
|
||||
// ── NoopAckHandle ─────────────────────────────────────────────────────────────
|
||||
|
||||
pub struct NoopAckHandle;
|
||||
|
||||
#[async_trait]
|
||||
impl AckHandle for NoopAckHandle {
|
||||
async fn ack(&self) -> Result<(), DomainError> {
|
||||
Ok(())
|
||||
}
|
||||
async fn nack(&self) -> Result<(), DomainError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
// ── NoopPersonCommand ─────────────────────────────────────────────────────────
|
||||
|
||||
pub struct NoopPersonCommand;
|
||||
|
||||
#[async_trait]
|
||||
impl PersonCommand for NoopPersonCommand {
|
||||
async fn upsert_batch(&self, _: &[Person]) -> Result<(), DomainError> {
|
||||
Ok(())
|
||||
}
|
||||
async fn backfill_from_credits_batch(&self, _: u32) -> Result<(u64, bool), DomainError> {
|
||||
Ok((0, false))
|
||||
}
|
||||
async fn update_enrichment(
|
||||
&self,
|
||||
_: &PersonId,
|
||||
_: &PersonEnrichmentData,
|
||||
) -> Result<(), DomainError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user