From 259ff937dc19996d3b1a31bfa9ad7c3f31fe3220 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:34:56 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20object=E3=82=92apObject=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=82=A8=E3=82=B9=E3=82=B1=E3=83=BC=E3=83=97?= =?UTF-8?q?=E3=81=AE=E5=BF=85=E8=A6=81=E3=82=92=E3=81=AA=E3=81=8F=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activitypub/domain/model/Accept.kt | 24 +++++++++------ .../activitypub/domain/model/Create.kt | 30 ++++++++++++------- .../activitypub/domain/model/Delete.kt | 13 ++++---- .../activitypub/domain/model/Follow.kt | 9 +++--- .../hideout/activitypub/domain/model/Like.kt | 24 ++++++++++----- .../activity/accept/ApAcceptProcessor.kt | 4 +-- .../create/ApSendCreateServiceImpl.kt | 2 +- .../create/CreateActivityProcessor.kt | 2 +- .../activity/delete/APDeleteProcessor.kt | 2 +- .../activity/follow/APFollowProcessor.kt | 4 +-- .../follow/APReceiveFollowJobProcessor.kt | 2 +- .../activity/follow/APReceiveFollowService.kt | 4 +-- .../activity/follow/APSendFollowService.kt | 2 +- .../service/activity/like/APLikeProcessor.kt | 2 +- .../activity/like/ApReactionJobProcessor.kt | 2 +- .../service/activity/undo/APUndoProcessor.kt | 6 ++-- .../follow/APSendFollowServiceImplTest.kt | 2 +- .../common/APRequestServiceImplTest.kt | 16 +++++----- .../hideout/ap/ContextSerializerTest.kt | 4 +-- 19 files changed, 90 insertions(+), 64 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Accept.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Accept.kt index 15eaf20f..93ded2d2 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Accept.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Accept.kt @@ -1,6 +1,7 @@ package dev.usbharu.hideout.activitypub.domain.model import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize import dev.usbharu.hideout.activitypub.domain.model.objects.Object import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer @@ -8,13 +9,13 @@ import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer open class Accept @JsonCreator constructor( type: List = emptyList(), override val name: String, - @JsonDeserialize(using = ObjectDeserializer::class) @Suppress("VariableNaming") var `object`: Object?, + @JsonDeserialize(using = ObjectDeserializer::class) + @JsonProperty("object") + val apObject: Object, override val actor: String ) : Object( type = add(type, "Accept") -), - HasActor, - HasName { +), HasActor, HasName { override fun equals(other: Any?): Boolean { if (this === other) return true @@ -23,22 +24,27 @@ open class Accept @JsonCreator constructor( other as Accept - if (`object` != other.`object`) return false - if (actor != other.actor) return false if (name != other.name) return false + if (apObject != other.apObject) return false + if (actor != other.actor) return false return true } override fun hashCode(): Int { var result = super.hashCode() - result = 31 * result + (`object`?.hashCode() ?: 0) - result = 31 * result + actor.hashCode() result = 31 * result + name.hashCode() + result = 31 * result + apObject.hashCode() + result = 31 * result + actor.hashCode() return result } override fun toString(): String { - return "Accept(" + "`object`=$`object`, " + "actor='$actor', " + "name='$name'" + ")" + " ${super.toString()}" + return "Accept(" + + "name='$name', " + + "apObject=$apObject, " + + "actor='$actor'" + + ")" + + " ${super.toString()}" } } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt index 6b6bb810..3353ea3c 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt @@ -1,5 +1,6 @@ package dev.usbharu.hideout.activitypub.domain.model +import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize import dev.usbharu.hideout.activitypub.domain.model.objects.Object import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer @@ -8,8 +9,8 @@ open class Create( type: List = emptyList(), override val name: String, @JsonDeserialize(using = ObjectDeserializer::class) - @Suppress("VariableNaming") - val `object`: Object, + @JsonProperty("object") + val apObject: Object, override val actor: String, override val id: String, val to: List = emptyList(), @@ -28,27 +29,36 @@ open class Create( other as Create - if (`object` != other.`object`) return false - if (to != other.to) return false - if (cc != other.cc) return false if (name != other.name) return false + if (apObject != other.apObject) return false if (actor != other.actor) return false if (id != other.id) return false + if (to != other.to) return false + if (cc != other.cc) return false return true } override fun hashCode(): Int { var result = super.hashCode() - result = 31 * result + (`object`?.hashCode() ?: 0) - result = 31 * result + to.hashCode() - result = 31 * result + cc.hashCode() result = 31 * result + name.hashCode() + result = 31 * result + apObject.hashCode() result = 31 * result + actor.hashCode() result = 31 * result + id.hashCode() + result = 31 * result + to.hashCode() + result = 31 * result + cc.hashCode() return result } - override fun toString(): String = - "Create(`object`=$`object`, to=$to, cc=$cc, name='$name', actor='$actor', id='$id') ${super.toString()}" + override fun toString(): String { + return "Create(" + + "name='$name', " + + "apObject=$apObject, " + + "actor='$actor', " + + "id='$id', " + + "to=$to, " + + "cc=$cc" + + ")" + + " ${super.toString()}" + } } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Delete.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Delete.kt index e4e8ccb0..f2142722 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Delete.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Delete.kt @@ -1,13 +1,14 @@ package dev.usbharu.hideout.activitypub.domain.model +import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize import dev.usbharu.hideout.activitypub.domain.model.objects.Object import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer open class Delete : Object, HasId, HasActor { @JsonDeserialize(using = ObjectDeserializer::class) - @Suppress("VariableNaming") - val `object`: Object + @JsonProperty("object") + val apObject: Object val published: String override val actor: String override val id: String @@ -19,7 +20,7 @@ open class Delete : Object, HasId, HasActor { `object`: Object, published: String ) : super(add(type, "Delete")) { - this.`object` = `object` + this.apObject = `object` this.published = published this.actor = actor this.id = id @@ -32,7 +33,7 @@ open class Delete : Object, HasId, HasActor { other as Delete - if (`object` != other.`object`) return false + if (apObject != other.apObject) return false if (published != other.published) return false if (actor != other.actor) return false if (id != other.id) return false @@ -42,7 +43,7 @@ open class Delete : Object, HasId, HasActor { override fun hashCode(): Int { var result = super.hashCode() - result = 31 * result + (`object`?.hashCode() ?: 0) + result = 31 * result + (apObject?.hashCode() ?: 0) result = 31 * result + (published?.hashCode() ?: 0) result = 31 * result + actor.hashCode() result = 31 * result + id.hashCode() @@ -50,5 +51,5 @@ open class Delete : Object, HasId, HasActor { } override fun toString(): String = - "Delete(`object`=$`object`, published=$published, actor='$actor', id='$id') ${super.toString()}" + "Delete(`object`=$apObject, published=$published, actor='$actor', id='$id') ${super.toString()}" } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Follow.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Follow.kt index d4ef2c95..c7f292ba 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Follow.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Follow.kt @@ -1,10 +1,11 @@ package dev.usbharu.hideout.activitypub.domain.model +import com.fasterxml.jackson.annotation.JsonProperty import dev.usbharu.hideout.activitypub.domain.model.objects.Object open class Follow( type: List = emptyList(), - @Suppress("VariableNaming") val `object`: String, + @JsonProperty("object") val apObject: String, override val actor: String ) : Object( type = add(type, "Follow") @@ -18,7 +19,7 @@ open class Follow( other as Follow - if (`object` != other.`object`) return false + if (apObject != other.apObject) return false if (actor != other.actor) return false return true @@ -26,10 +27,10 @@ open class Follow( override fun hashCode(): Int { var result = super.hashCode() - result = 31 * result + `object`.hashCode() + result = 31 * result + apObject.hashCode() result = 31 * result + actor.hashCode() return result } - override fun toString(): String = "Follow(`object`=$`object`, actor='$actor') ${super.toString()}" + override fun toString(): String = "Follow(`object`=$apObject, actor='$actor') ${super.toString()}" } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Like.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Like.kt index f4eaa13f..39ef65a2 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Like.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Like.kt @@ -1,5 +1,6 @@ package dev.usbharu.hideout.activitypub.domain.model +import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize import dev.usbharu.hideout.activitypub.domain.model.objects.Object import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer @@ -8,7 +9,7 @@ open class Like( type: List = emptyList(), override val actor: String, override val id: String, - @Suppress("VariableNaming") val `object`: String, + @JsonProperty("object") val apObject: String, val content: String, @JsonDeserialize(contentUsing = ObjectDeserializer::class) val tag: List = emptyList() ) : Object( @@ -24,26 +25,33 @@ open class Like( other as Like - if (`object` != other.`object`) return false - if (content != other.content) return false - if (tag != other.tag) return false if (actor != other.actor) return false if (id != other.id) return false + if (apObject != other.apObject) return false + if (content != other.content) return false + if (tag != other.tag) return false return true } override fun hashCode(): Int { var result = super.hashCode() - result = 31 * result + (`object`?.hashCode() ?: 0) - result = 31 * result + (content?.hashCode() ?: 0) - result = 31 * result + tag.hashCode() result = 31 * result + actor.hashCode() result = 31 * result + id.hashCode() + result = 31 * result + apObject.hashCode() + result = 31 * result + content.hashCode() + result = 31 * result + tag.hashCode() return result } override fun toString(): String { - return "Like(`object`=$`object`, content=$content, tag=$tag, actor='$actor', id='$id') ${super.toString()}" + return "Like(" + + "actor='$actor', " + + "id='$id', " + + "apObject='$apObject', " + + "content='$content', " + + "tag=$tag" + + ")" + + " ${super.toString()}" } } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/accept/ApAcceptProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/accept/ApAcceptProcessor.kt index 0567bf5f..68538572 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/accept/ApAcceptProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/accept/ApAcceptProcessor.kt @@ -20,7 +20,7 @@ class ApAcceptProcessor( AbstractActivityPubProcessor(transaction) { override suspend fun internalProcess(activity: ActivityPubProcessContext) { - val value = activity.activity.`object` ?: throw IllegalActivityPubObjectException("object is null") + val value = activity.activity.apObject ?: throw IllegalActivityPubObjectException("object is null") if (value.type.contains("Follow").not()) { logger.warn("FAILED Activity type isn't Follow.") @@ -29,7 +29,7 @@ class ApAcceptProcessor( val follow = value as Follow - val userUrl = follow.`object` + val userUrl = follow.apObject val followerUrl = follow.actor val user = userQueryService.findByUrl(userUrl) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/create/ApSendCreateServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/create/ApSendCreateServiceImpl.kt index 0d3eeac8..226f2a63 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/create/ApSendCreateServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/create/ApSendCreateServiceImpl.kt @@ -33,7 +33,7 @@ class ApSendCreateServiceImpl( val note = noteQueryService.findById(post.id).first val create = Create( name = "Create Note", - `object` = note, + apObject = note, actor = note.attributedTo, id = "${applicationConfig.url}/create/note/${post.id}" ) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/create/CreateActivityProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/create/CreateActivityProcessor.kt index 2e1b557c..827042ef 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/create/CreateActivityProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/create/CreateActivityProcessor.kt @@ -13,7 +13,7 @@ import org.springframework.stereotype.Service class CreateActivityProcessor(transaction: Transaction, private val apNoteService: APNoteService) : AbstractActivityPubProcessor(transaction) { override suspend fun internalProcess(activity: ActivityPubProcessContext) { - apNoteService.fetchNote(activity.activity.`object` as Note) + apNoteService.fetchNote(activity.activity.apObject as Note) } override fun isSupported(activityType: ActivityType): Boolean = activityType == ActivityType.Create diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/delete/APDeleteProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/delete/APDeleteProcessor.kt index f6f136fa..99f4b159 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/delete/APDeleteProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/delete/APDeleteProcessor.kt @@ -18,7 +18,7 @@ class APDeleteProcessor( ) : AbstractActivityPubProcessor(transaction) { override suspend fun internalProcess(activity: ActivityPubProcessContext) { - val value = activity.activity.`object` + val value = activity.activity.apObject if (value !is HasId) { throw IllegalActivityPubObjectException("object hasn't id") } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APFollowProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APFollowProcessor.kt index b56cd49f..847f4609 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APFollowProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APFollowProcessor.kt @@ -17,13 +17,13 @@ class APFollowProcessor( ) : AbstractActivityPubProcessor(transaction) { override suspend fun internalProcess(activity: ActivityPubProcessContext) { - logger.info("FOLLOW from: {} to {}", activity.activity.actor, activity.activity.`object`) + logger.info("FOLLOW from: {} to {}", activity.activity.actor, activity.activity.apObject) // inboxをジョブキューに乗せているので既に不要だが、フォロー承認制アカウントを実装する際に必要なので残す val jobProps = ReceiveFollowJobParam( activity.activity.actor, objectMapper.writeValueAsString(activity.activity), - activity.activity.`object` + activity.activity.apObject ) jobQueueParentService.scheduleTypeSafe(ReceiveFollowJob, jobProps) } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowJobProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowJobProcessor.kt index f8cf8556..0c3957b1 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowJobProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowJobProcessor.kt @@ -39,7 +39,7 @@ class APReceiveFollowJobProcessor( url = urlString, body = Accept( name = "Follow", - `object` = follow, + apObject = follow, actor = param.targetActor ), signer = signer diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowService.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowService.kt index 2011fce1..01d85a8b 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APReceiveFollowService.kt @@ -18,11 +18,11 @@ class APReceiveFollowServiceImpl( @Qualifier("activitypub") private val objectMapper: ObjectMapper ) : APReceiveFollowService { override suspend fun receiveFollow(follow: Follow) { - logger.info("FOLLOW from: {} to: {}", follow.actor, follow.`object`) + logger.info("FOLLOW from: {} to: {}", follow.actor, follow.apObject) jobQueueParentService.schedule(ReceiveFollowJob) { props[ReceiveFollowJob.actor] = follow.actor props[ReceiveFollowJob.follow] = objectMapper.writeValueAsString(follow) - props[ReceiveFollowJob.targetActor] = follow.`object` + props[ReceiveFollowJob.targetActor] = follow.apObject } return } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APSendFollowService.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APSendFollowService.kt index 554fa571..825ec198 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APSendFollowService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APSendFollowService.kt @@ -15,7 +15,7 @@ class APSendFollowServiceImpl( ) : APSendFollowService { override suspend fun sendFollow(sendFollowDto: SendFollowDto) { val follow = Follow( - `object` = sendFollowDto.followTargetUserId.url, + apObject = sendFollowDto.followTargetUserId.url, actor = sendFollowDto.userId.url ) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/like/APLikeProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/like/APLikeProcessor.kt index 9d56fe94..8938f017 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/like/APLikeProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/like/APLikeProcessor.kt @@ -23,7 +23,7 @@ class APLikeProcessor( val actor = activity.activity.actor val content = activity.activity.content - val target = activity.activity.`object` + val target = activity.activity.apObject val personWithEntity = apUserService.fetchPersonWithEntity(actor) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/like/ApReactionJobProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/like/ApReactionJobProcessor.kt index 3f73bb2e..1fee5eda 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/like/ApReactionJobProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/like/ApReactionJobProcessor.kt @@ -22,7 +22,7 @@ class ApReactionJobProcessor( param.inbox, Like( actor = param.actor, - `object` = param.postUrl, + apObject = param.postUrl, id = "${applicationConfig.url}/liek/note/${param.id}", content = param.reaction ), diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/undo/APUndoProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/undo/APUndoProcessor.kt index 99bd9ba1..16419348 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/undo/APUndoProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/undo/APUndoProcessor.kt @@ -32,12 +32,12 @@ class APUndoProcessor( "Follow" -> { val follow = undo.`object` as Follow - if (follow.`object` == null) { + if (follow.apObject == null) { return } - apUserService.fetchPerson(undo.actor, follow.`object`) + apUserService.fetchPerson(undo.actor, follow.apObject) val follower = userQueryService.findByUrl(undo.actor) - val target = userQueryService.findByUrl(follow.`object`) + val target = userQueryService.findByUrl(follow.apObject) userService.unfollow(target.id, follower.id) return } diff --git a/src/test/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APSendFollowServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APSendFollowServiceImplTest.kt index 93e1d76d..0fe5f689 100644 --- a/src/test/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APSendFollowServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/activitypub/service/activity/follow/APSendFollowServiceImplTest.kt @@ -24,7 +24,7 @@ class APSendFollowServiceImplTest { apSendFollowServiceImpl.sendFollow(sendFollowDto) val value = Follow( - `object` = sendFollowDto.followTargetUserId.url, + apObject = sendFollowDto.followTargetUserId.url, actor = sendFollowDto.userId.url ) verify(apRequestService, times(1)).apPost( diff --git a/src/test/kotlin/dev/usbharu/hideout/activitypub/service/common/APRequestServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/activitypub/service/common/APRequestServiceImplTest.kt index 2c609183..2bb41d56 100644 --- a/src/test/kotlin/dev/usbharu/hideout/activitypub/service/common/APRequestServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/activitypub/service/common/APRequestServiceImplTest.kt @@ -47,7 +47,7 @@ class APRequestServiceImplTest { ) val responseClass = Follow( - `object` = "https://example.com", + apObject = "https://example.com", actor = "https://example.com" ) apRequestServiceImpl.apGet("https://example.com", responseClass = responseClass::class.java) @@ -72,7 +72,7 @@ class APRequestServiceImplTest { ) val responseClass = Follow( - `object` = "https://example.com", + apObject = "https://example.com", actor = "https://example.com" ) apRequestServiceImpl.apGet( @@ -112,7 +112,7 @@ class APRequestServiceImplTest { ) val responseClass = Follow( - `object` = "https://example.com", + apObject = "https://example.com", actor = "https://example.com" ) apRequestServiceImpl.apGet( @@ -163,7 +163,7 @@ class APRequestServiceImplTest { }), objectMapper, mock(), dateTimeFormatter) val body = Follow( - `object` = "https://example.com", + apObject = "https://example.com", actor = "https://example.com" ) apRequestServiceImpl.apPost("https://example.com", body, null) @@ -209,7 +209,7 @@ class APRequestServiceImplTest { }), objectMapper, mock(), dateTimeFormatter) val body = Follow( - `object` = "https://example.com", + apObject = "https://example.com", actor = "https://example.com" ) apRequestServiceImpl.apPost("https://example.com", body, null) @@ -239,7 +239,7 @@ class APRequestServiceImplTest { }), objectMapper, mock(), dateTimeFormatter) val body = Follow( - `object` = "https://example.com", + apObject = "https://example.com", actor = "https://example.com" ) apRequestServiceImpl.apPost("https://example.com", body, UserBuilder.remoteUserOf()) @@ -280,7 +280,7 @@ class APRequestServiceImplTest { }), objectMapper, httpSignatureSigner, dateTimeFormatter) val body = Follow( - `object` = "https://example.com", + apObject = "https://example.com", actor = "https://example.com" ) apRequestServiceImpl.apPost( @@ -330,7 +330,7 @@ class APRequestServiceImplTest { }), objectMapper, mock(), dateTimeFormatter) val body = Follow( - `object` = "https://example.com", + apObject = "https://example.com", actor = "https://example.com" ) val actual = apRequestServiceImpl.apPost("https://example.com", body, null, body::class.java) diff --git a/src/test/kotlin/dev/usbharu/hideout/ap/ContextSerializerTest.kt b/src/test/kotlin/dev/usbharu/hideout/ap/ContextSerializerTest.kt index d73e31d7..a141c11b 100644 --- a/src/test/kotlin/dev/usbharu/hideout/ap/ContextSerializerTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/ap/ContextSerializerTest.kt @@ -12,8 +12,8 @@ class ContextSerializerTest { val accept = Accept( name = "aaa", actor = "bbb", - `object` = Follow( - `object` = "ddd", + apObject = Follow( + apObject = "ddd", actor = "aaa" ) )