From e3a5995acb198366cb55c16fc55d8c419801cd78 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:00:11 +0900 Subject: [PATCH] =?UTF-8?q?test:=20Undo=E3=81=ABMastodon=E3=81=AEJSON?= =?UTF-8?q?=E3=81=AE=E3=83=87=E3=82=B7=E3=83=AA=E3=82=A2=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activitypub/domain/model/UndoTest.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/test/kotlin/dev/usbharu/hideout/activitypub/domain/model/UndoTest.kt b/src/test/kotlin/dev/usbharu/hideout/activitypub/domain/model/UndoTest.kt index ea279694..ad111d27 100644 --- a/src/test/kotlin/dev/usbharu/hideout/activitypub/domain/model/UndoTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/activitypub/domain/model/UndoTest.kt @@ -71,4 +71,25 @@ class UndoTest { val undo = ActivityPubConfig().objectMapper().readValue(json, Undo::class.java) println(undo) } + + @Test + fun MastodonのUndoのデシリアライズができる() { + //language=JSON + val json = """{ + "@context" : "https://www.w3.org/ns/activitystreams", + "id" : "https://kb.usbharu.dev/users/usbharu#follows/12/undo", + "type" : "Undo", + "actor" : "https://kb.usbharu.dev/users/usbharu", + "object" : { + "id" : "https://kb.usbharu.dev/0347b269-4dcb-4eb1-b8c4-b5f157bb6957", + "type" : "Follow", + "actor" : "https://kb.usbharu.dev/users/usbharu", + "object" : "https://test-hideout.usbharu.dev/users/testuser15" + } +}""".trimIndent() + + val undo = ActivityPubConfig().objectMapper().readValue(json, Undo::class.java) + + println(undo) + } }