From 84bf0a22f1ba8c7e7aba96a4b577d7925c6e3035 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 26 May 2020 18:51:59 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=8E=A8=20Specify=20types=20for=20mocks=20e?= =?utf8?q?xplicitely?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 -- 2.7.4