test: UndoにMastodonのJSONのデシリアライズテストを追加

This commit is contained in:
usbharu 2024-01-29 11:00:11 +09:00
parent ed715e0af4
commit e3a5995acb
1 changed files with 21 additions and 0 deletions

View File

@ -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<Undo>(json, Undo::class.java)
println(undo)
}
}