test: テストを修正

This commit is contained in:
usbharu 2024-07-20 16:19:34 +09:00
parent d0ff47525f
commit edae599978
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package dev.usbharu.hideout.core.domain.model.post package dev.usbharu.hideout.core.domain.model.post
import dev.usbharu.hideout.core.domain.model.actor.ActorId import dev.usbharu.hideout.core.domain.model.actor.ActorId
import dev.usbharu.hideout.core.domain.model.instance.InstanceId
import dev.usbharu.hideout.core.domain.model.media.MediaId import dev.usbharu.hideout.core.domain.model.media.MediaId
import dev.usbharu.hideout.core.infrastructure.other.TwitterSnowflakeIdGenerateService import dev.usbharu.hideout.core.infrastructure.other.TwitterSnowflakeIdGenerateService
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
@ -13,6 +14,7 @@ object TestPostFactory {
fun create( fun create(
id: Long = generateId(), id: Long = generateId(),
actorId: Long = 1, actorId: Long = 1,
instanceId: Long = 1,
overview: String? = null, overview: String? = null,
content: String = "This is test content", content: String = "This is test content",
createdAt: Instant = Instant.now(), createdAt: Instant = Instant.now(),
@ -31,20 +33,21 @@ object TestPostFactory {
return Post( return Post(
PostId(id), PostId(id),
ActorId(actorId), ActorId(actorId),
instanceId = InstanceId(instanceId),
overview = overview?.let { PostOverview(it) }, overview = overview?.let { PostOverview(it) },
content = PostContent(content, content, emptyList()), content = PostContent(content, content, emptyList()),
createdAt = createdAt, createdAt = createdAt,
visibility = visibility, visibility = visibility,
url = url, url = url,
repostId = repostId?.let { PostId(it) }, repostId = repostId?.let { PostId(it) },
replyId?.let { PostId(it) }, replyId = replyId?.let { PostId(it) },
sensitive = sensitive, sensitive = sensitive,
apId = apId, apId = apId,
deleted = deleted, deleted = deleted,
mediaIds.map { MediaId(it) }, mediaIds = mediaIds.map { MediaId(it) },
visibleActors.map { ActorId(it) }.toSet(), visibleActors = visibleActors.map { ActorId(it) }.toSet(),
hide = hide, hide = hide,
moveTo?.let { PostId(it) } moveTo = moveTo?.let { PostId(it) }
) )
} }