From 7a89569f667264ec7afd2be310cff3c22ca9d03e Mon Sep 17 00:00:00 2001 From: Clemens Date: Fri, 14 Jul 2023 13:47:59 +0200 Subject: [PATCH] fixed test added Note --- .../activity_pub_poc/activitystreams2.clj | 5 +++++ .../domaindrivenarchitecture/activity_pub_poc/core.clj | 2 +- .../activity_pub_poc/core_test.clj | 9 ++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj index 05ef6df..e11e1ca 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj @@ -39,6 +39,11 @@ (s/def ::Relationship (s/keys :req-un [::object ::und-mehr])) +; #### NOTE #### +; Specialities of mastodon statuses: https://docs.joinmastodon.org/spec/activitypub/#status +(s/def ::Note (s/and ::Object + (match-type "Note"))) + ; #### ACTIVITY #### (s/def ::Activity (s/merge ::Object diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj index b41b2c3..180e2e8 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj @@ -67,7 +67,7 @@ actor object])) -(def like-data? (s/keys :req-un [::to ::object ::from])) +(def like-data? (s/keys :req-un [::object ::from])) (def activity-streams-context "https://www.w3.org/ns/activitystreams") diff --git a/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj b/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj index 4bb3f1f..0b9c6ac 100644 --- a/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj +++ b/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj @@ -7,15 +7,14 @@ (st/instrument `sut/generate-like-map) (def test-like-data - {:to "https://chatty.bla/ben/" - :target "posts/234s23-2g34234-2hhj536" + {:object "posts/234s23-2g34234-2hhj536" :from "https://social.bla/alyssa/"}) (deftest produces-valid-like (is (= {"@context" "https://www.w3.org/ns/activitystreams", + "id" "https://social.bla/alyssa/#likes/RANDOMHASH", "type" "Like", - "id" "https://social.bla/alyssa/out/sdfsd44243g324g3455", - "to" "https://chatty.bla/ben/", "actor" "https://social.bla/alyssa/", "object" "posts/234s23-2g34234-2hhj536"} - (sut/generate-like-map test-like-data)))) \ No newline at end of file + (sut/generate-like-map test-like-data)))) +