X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FIdentities.kt;h=c6c64166c45b255b57ecadf263cd8659b1299935;hp=57ab8c578cdd6fc2123b68a0155f996965d7491f;hb=2f1e414e86c61435cd8b3991c475e0832f6de2fb;hpb=6a5b585e731597b33beed8f58a0e79b9f0c37f96 diff --git a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/Identities.kt b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/Identities.kt index 57ab8c5..c6c6416 100644 --- a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/Identities.kt +++ b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/Identities.kt @@ -1,5 +1,5 @@ /* - * Sone - Identities.java - Copyright © 2013–2019 David Roden + * Sone - Identities.kt - Copyright © 2013–2019 David 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 @@ -17,19 +17,19 @@ package net.pterodactylus.sone.freenet.wot -fun createOwnIdentity(id: String, contexts: Collection, vararg properties: Pair): OwnIdentity { +fun createOwnIdentity(id: String, contexts: Set, vararg properties: Pair): OwnIdentity { val ownIdentity = DefaultOwnIdentity(id, "Nickname$id", "Request$id", "Insert$id") setContextsAndPropertiesOnIdentity(ownIdentity, contexts, mapOf(*properties)) return ownIdentity } -fun createIdentity(id: String, contexts: Collection, vararg properties: Pair): Identity { +fun createIdentity(id: String, contexts: Set, vararg properties: Pair): Identity { val identity = DefaultIdentity(id, "Nickname$id", "Request$id") setContextsAndPropertiesOnIdentity(identity, contexts, mapOf(*properties)) return identity } -private fun setContextsAndPropertiesOnIdentity(identity: Identity, contexts: Collection, properties: Map) { - identity.setContexts(contexts) +private fun setContextsAndPropertiesOnIdentity(identity: Identity, contexts: Set, properties: Map) { + identity.contexts = contexts identity.properties = properties }