From: David ‘Bombe’ Roden Date: Tue, 26 May 2020 16:51:59 +0000 (+0200) Subject: 🎨 Specify types for mocks explicitely X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=84bf0a22f1ba8c7e7aba96a4b577d7925c6e3035;p=Sone.git 🎨 Specify types for mocks explicitely --- 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