From 00d24b5030eaf0eeab7a815dfa1dd6e4ccfde16f Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:11:14 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../usbharu/hideout/application/config/ActivityPubConfig.kt | 4 ++++ .../service/activity/follow/APReceiveFollowServiceImplTest.kt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/application/config/ActivityPubConfig.kt b/src/main/kotlin/dev/usbharu/hideout/application/config/ActivityPubConfig.kt index 02678334..d6bdf301 100644 --- a/src/main/kotlin/dev/usbharu/hideout/application/config/ActivityPubConfig.kt +++ b/src/main/kotlin/dev/usbharu/hideout/application/config/ActivityPubConfig.kt @@ -3,6 +3,7 @@ package dev.usbharu.hideout.application.config import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls +import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.databind.DeserializationFeature import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper @@ -25,6 +26,9 @@ class ActivityPubConfig { .setSerializationInclusion(JsonInclude.Include.NON_EMPTY) .setDefaultSetterInfo(JsonSetter.Value.forContentNulls(Nulls.AS_EMPTY)) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .configure(JsonParser.Feature.ALLOW_COMMENTS, true) + .configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true) + .configure(JsonParser.Feature.ALLOW_TRAILING_COMMA, true) return objectMapper } diff --git a/src/test/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowServiceImplTest.kt index a416d82a..d80183dd 100644 --- a/src/test/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowServiceImplTest.kt @@ -70,8 +70,8 @@ class APReceiveFollowServiceImplTest { "type": "Follow", "name": "Follow", "actor": "https://follower.example.com", - "object": "https://example.com", - "@context": null + "object": "https://example.com" + }""" ), Json.parseToJsonElement(follow)