|
|
|
@ -6,16 +6,18 @@
|
|
|
|
|
[org.domaindrivenarchitecture.activity-pub-poc.core :as sut]))
|
|
|
|
|
|
|
|
|
|
(deftest should-serailize
|
|
|
|
|
(is (= (str "{\"@context\": \"https://www.w3.org/ns/activitystreams\", "
|
|
|
|
|
"\"summary\": \"Sally liked a note\", "
|
|
|
|
|
"\"type\": \"Like\", "
|
|
|
|
|
"\"actor\": {"
|
|
|
|
|
"\"type\": \"Person\", "
|
|
|
|
|
"\"name\": \"Sally\"}, "
|
|
|
|
|
"\"object\": \"http://example.org/notes/1\"}")
|
|
|
|
|
(is (= (str "{\"@context\":\"https://www.w3.org/ns/activitystreams\","
|
|
|
|
|
"\"id\":\"http://example.org/likes/1\","
|
|
|
|
|
"\"summary\":\"Sally liked a note\","
|
|
|
|
|
"\"type\":\"Like\","
|
|
|
|
|
"\"actor\":{"
|
|
|
|
|
"\"type\":\"Person\","
|
|
|
|
|
"\"name\":\"Sally\"},"
|
|
|
|
|
"\"object\":\"http://example.org/notes/1\"}")
|
|
|
|
|
(sut/serialize
|
|
|
|
|
{:summary "Sally liked a note",
|
|
|
|
|
:type "Like",
|
|
|
|
|
:actor {:type "Person",
|
|
|
|
|
:name "Sally"},
|
|
|
|
|
:object "http://example.org/notes/1"}))))
|
|
|
|
|
{::as/id ["http://example.org/likes/1"]
|
|
|
|
|
::as/summary "Sally liked a note",
|
|
|
|
|
::as/type "Like",
|
|
|
|
|
::as/actor {::as/type "Person",
|
|
|
|
|
::as/name "Sally"},
|
|
|
|
|
::as/object "http://example.org/notes/1"}))))
|