feat(domain): ActorConnectionSummary, ConnectionType, RemoteActorConnectionRepository, FetchActorConnections event

This commit is contained in:
2026-05-15 00:25:54 +02:00
parent 23501f5203
commit 99dd89b60d
8 changed files with 178 additions and 0 deletions

View File

@@ -575,6 +575,52 @@ impl FederationActionPort for TestStore {
) -> Result<Vec<crate::models::remote_note::RemoteNote>, DomainError> {
Ok(vec![])
}
async fn fetch_actor_urls_from_collection(
&self,
_collection_url: &str,
) -> Result<Vec<String>, DomainError> {
Ok(vec![])
}
async fn resolve_actor_profiles(
&self,
_urls: Vec<String>,
) -> Vec<crate::models::actor_connection_summary::ActorConnectionSummary> {
vec![]
}
}
#[async_trait]
impl RemoteActorConnectionRepository for TestStore {
async fn upsert_connections(
&self,
_actor_url: &str,
_connection_type: &str,
_page: u32,
_actors: &[crate::models::actor_connection_summary::ActorConnectionSummary],
) -> Result<(), DomainError> {
Ok(())
}
async fn list_connections(
&self,
_actor_url: &str,
_connection_type: &str,
_page: u32,
) -> Result<Vec<crate::models::actor_connection_summary::ActorConnectionSummary>, DomainError>
{
Ok(vec![])
}
async fn connection_page_age(
&self,
_actor_url: &str,
_connection_type: &str,
_page: u32,
) -> Result<Option<chrono::DateTime<chrono::Utc>>, DomainError> {
Ok(None)
}
}
#[async_trait]
@@ -851,6 +897,25 @@ mod federation_port_tests {
.unwrap();
assert!(notes.is_empty());
}
#[tokio::test]
async fn test_store_resolve_actor_profiles_returns_empty() {
let store = TestStore::default();
let result = store
.resolve_actor_profiles(vec!["https://example.com/users/alice".into()])
.await;
assert!(result.is_empty());
}
#[tokio::test]
async fn test_store_fetch_collection_urls_returns_empty() {
let store = TestStore::default();
let urls = store
.fetch_actor_urls_from_collection("https://example.com/users/alice/followers")
.await
.unwrap();
assert!(urls.is_empty());
}
}
#[cfg(test)]