X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ftest%2FMocks.kt;h=d21d59250ac57b0dd1e9146440c98300306707ad;hb=84bf0a22f1ba8c7e7aba96a4b577d7925c6e3035;hp=a25fa5da53f3186a000a8e477a1d6d21353d1d9c;hpb=64740709990291688170ebd1f192af5eb9090618;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt b/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt index a25fa5d..d21d592 100644 --- a/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt +++ b/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt @@ -35,14 +35,15 @@ val createRequestUri: FreenetURI get() = InsertableClientSSK.createRandom(DummyR val createInsertUri: FreenetURI get() = InsertableClientSSK.createRandom(DummyRandomSource(), "").insertURI fun createId() = InsertableClientSSK.createRandom(DummyRandomSource(), "").uri.routingKey.asFreenetBase64 -fun createLocalSone(id: String? = createId()) = object : IdOnlySone(id) { +fun createLocalSone(id: String? = createId()): Sone = object : IdOnlySone(id) { private val options = DefaultSoneOptions() override fun getOptions() = options override fun isLocal() = true } -fun createRemoteSone(id: String? = createId()) = IdOnlySone(id) -fun createPost(text: String = "", sone: Sone = remoteSone1, known: Boolean = false, time: Long = 1): Post.EmptyPost { +fun createRemoteSone(id: String? = createId()): Sone = IdOnlySone(id) + +fun createPost(text: String = "", sone: Sone = remoteSone1, known: Boolean = false, time: Long = 1): Post { return object : Post.EmptyPost("post-id") { override fun getSone() = sone override fun getText() = text