X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ftest%2FMocks.kt;h=312f158b3bd4522ab94d1492987b64f5ea567299;hb=d59dcba3dbf5d1f9327dd7b370b96bded9d79ccc;hp=39756f6b586a851d1c3b832315fe576dc170a0fd;hpb=8bbd85568dc97aa6741835e45a40cc7a0e44691f;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 39756f6..312f158 100644 --- a/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt +++ b/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt @@ -1,5 +1,5 @@ /** - * Sone - Mocks.kt - Copyright © 2019 David ‘Bombe’ Roden + * Sone - Mocks.kt - Copyright © 2019–2020 David ‘Bombe’ Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ import com.google.common.base.* import freenet.crypt.* import freenet.keys.* import net.pterodactylus.sone.data.* +import net.pterodactylus.sone.data.SoneOptions.* import net.pterodactylus.sone.data.impl.* import net.pterodactylus.sone.text.* import net.pterodactylus.sone.utils.* @@ -31,9 +32,12 @@ val remoteSone2 = createRemoteSone() val localSone1 = createLocalSone() val localSone2 = createLocalSone() +val createInsertUri: FreenetURI get() = InsertableClientSSK.createRandom(DummyRandomSource(), "").insertURI fun createId() = InsertableClientSSK.createRandom(DummyRandomSource(), "").uri.routingKey.asFreenetBase64 fun createLocalSone(id: String? = createId()) = object : IdOnlySone(id) { + private val options = DefaultSoneOptions() + override fun getOptions() = options override fun isLocal() = true } fun createRemoteSone(id: String? = createId()) = IdOnlySone(id)