mirror of https://github.com/usbharu/Hideout.git
test: テストを修正
This commit is contained in:
parent
d0ff47525f
commit
edae599978
|
@ -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) }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue