From 606c306d70bd920199721df2a22d6ef4bee57e36 Mon Sep 17 00:00:00 2001 From: Tim Yiu Date: Fri, 22 Sep 2023 14:02:54 -0700 Subject: [PATCH] update evaluation package, LoadStoreCache --- .../EvaluationAllocation.kt | 2 +- .../EvaluationBucket.kt | 2 +- .../EvaluationCondition.kt | 2 +- .../EvaluationContext.kt | 2 +- .../EvaluationDistribution.kt | 2 +- .../EvaluationEngine.kt | 4 +- .../EvaluationFlag.kt | 2 +- .../EvaluationOperator.kt | 2 +- .../EvaluationSegment.kt | 2 +- .../EvaluationSerialization.kt | 0 .../EvaluationVariant.kt | 2 +- .../{evaluation-core => evaluation}/Logger.kt | 6 +- .../Murmur3.kt | 0 .../Selectable.kt | 0 .../SemanticVersion.kt | 0 .../TopologicalSort.kt | 6 +- .../java/com/amplitude/experiment/FlagApi.kt | 15 ++--- .../com/amplitude/experiment/storage/Cache.kt | 34 +++++----- .../com/amplitude/experiment/util/Flag.kt | 62 ------------------- .../com/amplitude/experiment/StorageTest.kt | 16 ++--- 20 files changed, 51 insertions(+), 110 deletions(-) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationAllocation.kt (81%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationBucket.kt (92%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationCondition.kt (88%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationContext.kt (64%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationDistribution.kt (88%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationEngine.kt (99%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationFlag.kt (95%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationOperator.kt (96%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationSegment.kt (96%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationSerialization.kt (100%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/EvaluationVariant.kt (93%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/Logger.kt (94%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/Murmur3.kt (100%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/Selectable.kt (100%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/SemanticVersion.kt (100%) rename sdk/src/main/java/com/amplitude/{evaluation-core => evaluation}/TopologicalSort.kt (92%) delete mode 100644 sdk/src/main/java/com/amplitude/experiment/util/Flag.kt diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationAllocation.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationAllocation.kt similarity index 81% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationAllocation.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationAllocation.kt index 93312e3..b988d6b 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationAllocation.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationAllocation.kt @@ -3,7 +3,7 @@ package com.amplitude.experiment.evaluation import kotlinx.serialization.Serializable @Serializable -data class EvaluationAllocation( +internal data class EvaluationAllocation( val range: List, val distributions: List, ) diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationBucket.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationBucket.kt similarity index 92% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationBucket.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationBucket.kt index b40814f..e8cc31e 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationBucket.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationBucket.kt @@ -3,7 +3,7 @@ package com.amplitude.experiment.evaluation import kotlinx.serialization.Serializable @Serializable -data class EvaluationBucket( +internal data class EvaluationBucket( // How to select the prop from the context. val selector: List, diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationCondition.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationCondition.kt similarity index 88% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationCondition.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationCondition.kt index 02ee8c9..2a6102e 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationCondition.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationCondition.kt @@ -3,7 +3,7 @@ package com.amplitude.experiment.evaluation import kotlinx.serialization.Serializable @Serializable -data class EvaluationCondition( +internal data class EvaluationCondition( // How to select the property from the evaluation state. val selector: List, diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationContext.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationContext.kt similarity index 64% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationContext.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationContext.kt index 88d3fb4..e8d8120 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationContext.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationContext.kt @@ -3,7 +3,7 @@ package com.amplitude.experiment.evaluation import kotlinx.serialization.Serializable @Serializable -class EvaluationContext : MutableMap by LinkedHashMap(), Selectable { +internal class EvaluationContext : MutableMap by LinkedHashMap(), Selectable { override fun select(selector: String): Any? = this[selector] } diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationDistribution.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationDistribution.kt similarity index 88% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationDistribution.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationDistribution.kt index 158f041..af70556 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationDistribution.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationDistribution.kt @@ -3,7 +3,7 @@ package com.amplitude.experiment.evaluation import kotlinx.serialization.Serializable @Serializable -data class EvaluationDistribution( +internal data class EvaluationDistribution( // The key of the variant to deliver if this range matches. val variant: String, diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationEngine.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationEngine.kt similarity index 99% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationEngine.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationEngine.kt index 1f138f3..860e93e 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationEngine.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationEngine.kt @@ -5,14 +5,14 @@ import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.JsonArray -interface EvaluationEngine { +internal interface EvaluationEngine { fun evaluate( context: EvaluationContext, flags: List ): Map } -class EvaluationEngineImpl(private val log: Logger? = DefaultLogger()) : EvaluationEngine { +internal class EvaluationEngineImpl(private val log: Logger? = DefaultLogger()) : EvaluationEngine { data class EvaluationTarget( val context: EvaluationContext, diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationFlag.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationFlag.kt similarity index 95% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationFlag.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationFlag.kt index 66563e7..a567ad2 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationFlag.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationFlag.kt @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers @Serializable -data class EvaluationFlag( +internal data class EvaluationFlag( // The flag key. Must be unique for deployment. val key: String, diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationOperator.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationOperator.kt similarity index 96% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationOperator.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationOperator.kt index 0dce016..98276fc 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationOperator.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationOperator.kt @@ -1,6 +1,6 @@ package com.amplitude.experiment.evaluation -object EvaluationOperator { +internal object EvaluationOperator { const val IS = "is" const val IS_NOT = "is not" const val CONTAINS = "contains" diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationSegment.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationSegment.kt similarity index 96% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationSegment.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationSegment.kt index 5550180..f5b4417 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationSegment.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationSegment.kt @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers @Serializable -data class EvaluationSegment( +internal data class EvaluationSegment( // How to bucket the user given a matching condition. val bucket: EvaluationBucket? = null, diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationSerialization.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationSerialization.kt similarity index 100% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationSerialization.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationSerialization.kt diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationVariant.kt b/sdk/src/main/java/com/amplitude/evaluation/EvaluationVariant.kt similarity index 93% rename from sdk/src/main/java/com/amplitude/evaluation-core/EvaluationVariant.kt rename to sdk/src/main/java/com/amplitude/evaluation/EvaluationVariant.kt index bdd63e5..bf49fbb 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/EvaluationVariant.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/EvaluationVariant.kt @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers @Serializable -data class EvaluationVariant( +internal data class EvaluationVariant( val key: String, val value: Any? = null, val payload: Any? = null, diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/Logger.kt b/sdk/src/main/java/com/amplitude/evaluation/Logger.kt similarity index 94% rename from sdk/src/main/java/com/amplitude/evaluation-core/Logger.kt rename to sdk/src/main/java/com/amplitude/evaluation/Logger.kt index cc591f6..6afbd8d 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/Logger.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/Logger.kt @@ -1,6 +1,6 @@ package com.amplitude.experiment.evaluation -enum class Level { +internal enum class Level { VERBOSE, DEBUG, INFO, @@ -8,7 +8,7 @@ enum class Level { ERROR } -interface Logger { +internal interface Logger { fun verbose(log: () -> String) fun debug(log: () -> String) fun info(log: () -> String) @@ -16,7 +16,7 @@ interface Logger { fun error(e: Throwable? = null, log: () -> String) } -class DefaultLogger( +internal class DefaultLogger( private val level: Level = Level.ERROR, private val tag: String = "Experiment" ) : Logger { diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/Murmur3.kt b/sdk/src/main/java/com/amplitude/evaluation/Murmur3.kt similarity index 100% rename from sdk/src/main/java/com/amplitude/evaluation-core/Murmur3.kt rename to sdk/src/main/java/com/amplitude/evaluation/Murmur3.kt diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/Selectable.kt b/sdk/src/main/java/com/amplitude/evaluation/Selectable.kt similarity index 100% rename from sdk/src/main/java/com/amplitude/evaluation-core/Selectable.kt rename to sdk/src/main/java/com/amplitude/evaluation/Selectable.kt diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/SemanticVersion.kt b/sdk/src/main/java/com/amplitude/evaluation/SemanticVersion.kt similarity index 100% rename from sdk/src/main/java/com/amplitude/evaluation-core/SemanticVersion.kt rename to sdk/src/main/java/com/amplitude/evaluation/SemanticVersion.kt diff --git a/sdk/src/main/java/com/amplitude/evaluation-core/TopologicalSort.kt b/sdk/src/main/java/com/amplitude/evaluation/TopologicalSort.kt similarity index 92% rename from sdk/src/main/java/com/amplitude/evaluation-core/TopologicalSort.kt rename to sdk/src/main/java/com/amplitude/evaluation/TopologicalSort.kt index 0a1e365..078fe9a 100644 --- a/sdk/src/main/java/com/amplitude/evaluation-core/TopologicalSort.kt +++ b/sdk/src/main/java/com/amplitude/evaluation/TopologicalSort.kt @@ -1,12 +1,12 @@ package com.amplitude.experiment.evaluation -class CycleException(val cycle: Set) : RuntimeException() { +internal class CycleException(val cycle: Set) : RuntimeException() { override val message: String get() = "Detected a cycle between flags $cycle" } @Throws(CycleException::class) -fun topologicalSort( +internal fun topologicalSort( flagConfigs: List, flagKeys: Set = setOf() ): List { @@ -14,7 +14,7 @@ fun topologicalSort( } @Throws(CycleException::class) -fun topologicalSort( +internal fun topologicalSort( flagConfigs: Map, flagKeys: Set = setOf() ): List { diff --git a/sdk/src/main/java/com/amplitude/experiment/FlagApi.kt b/sdk/src/main/java/com/amplitude/experiment/FlagApi.kt index e09bb71..5d830d1 100644 --- a/sdk/src/main/java/com/amplitude/experiment/FlagApi.kt +++ b/sdk/src/main/java/com/amplitude/experiment/FlagApi.kt @@ -1,9 +1,10 @@ package com.amplitude.experiment import com.amplitude.experiment.evaluation.EvaluationFlag +import com.amplitude.experiment.evaluation.json import com.amplitude.experiment.util.AsyncFuture import com.amplitude.experiment.util.Logger -import com.amplitude.experiment.util.toFlag +import kotlinx.serialization.decodeFromString import okhttp3.* import okhttp3.HttpUrl.Companion.toHttpUrl import org.json.JSONArray @@ -11,18 +12,18 @@ import java.io.IOException import java.util.concurrent.Future import java.util.concurrent.TimeUnit -data class GetFlagsOptions( +internal data class GetFlagsOptions( val libraryName: String, val libraryVersion: String, val evaluationMode: String? = null, val timeoutMillis: Long = ExperimentConfig.Defaults.FETCH_TIMEOUT_MILLIS ) -interface FlagApi { +internal interface FlagApi { fun getFlags(options: GetFlagsOptions? = null): Future> } -class SdkFlagApi( +internal class SdkFlagApi( private val deploymentKey: String, private val serverUrl: String, private val httpClient: OkHttpClient @@ -56,10 +57,10 @@ class SdkFlagApi( val jsonArray = JSONArray(body) val flags = mutableMapOf() (0 until jsonArray.length()).forEach { - val json = jsonArray.getJSONObject(it) - val flag = json.toFlag() + val jsonString = jsonArray.getString(it) + val flag = json.decodeFromString(jsonString) if (flag != null) { - flags[json.getString("key")] = flag + flags[flag.key] = flag } } diff --git a/sdk/src/main/java/com/amplitude/experiment/storage/Cache.kt b/sdk/src/main/java/com/amplitude/experiment/storage/Cache.kt index 6fc8d8e..dd761dc 100644 --- a/sdk/src/main/java/com/amplitude/experiment/storage/Cache.kt +++ b/sdk/src/main/java/com/amplitude/experiment/storage/Cache.kt @@ -2,14 +2,17 @@ package com.amplitude.experiment.storage import com.amplitude.experiment.Variant import com.amplitude.experiment.evaluation.EvaluationFlag -import com.amplitude.experiment.util.toFlag +import com.amplitude.experiment.evaluation.json import com.amplitude.experiment.util.toVariant import com.amplitude.experiment.util.toJson +import kotlinx.serialization.decodeFromString +import kotlinx.serialization.encodeToString -internal class LoadStoreCache( +internal class LoadStoreCache( private val namespace: String, private val storage: Storage, - private val transformer: ((value: String) -> V?) + private val decoder: ((value: String) -> V?), + private val encoder: ((value: V) -> String) ) { private val cache: MutableMap = mutableMapOf() @@ -41,7 +44,7 @@ internal class LoadStoreCache( val rawValues = storage.get(namespace) val values = rawValues.mapNotNull { entry -> try { - val value = transformer.invoke(entry.value) + val value = decoder.invoke(entry.value) if (value != null) { entry.key to value } else { @@ -58,7 +61,7 @@ internal class LoadStoreCache( fun store(values: MutableMap = cache) = synchronized(cache) { val stringValues = values.mapNotNull { entry -> try { - val value = transformStringFromV(entry.value) + val value = encoder(entry.value) if (value != null) { entry.key to value } else { @@ -75,7 +78,7 @@ internal class LoadStoreCache( internal fun getVariantStorage(deploymentKey: String, instanceName: String, storage: Storage): LoadStoreCache { val truncatedDeployment = deploymentKey.takeLast(6) val namespace = "amp-exp-$instanceName-$truncatedDeployment" - return LoadStoreCache(namespace, storage, ::transformVariantFromStorage) + return LoadStoreCache(namespace, storage, ::decodeVariantFromStorage, ::encodeVariantToStorage) } internal fun getFlagStorage( @@ -85,22 +88,21 @@ internal fun getFlagStorage( ): LoadStoreCache { val truncatedDeployment = deploymentKey.takeLast(6) val namespace = "amp-exp-$instanceName-$truncatedDeployment-flags" - return LoadStoreCache(namespace, storage, ::transformFlagFromStorage) + return LoadStoreCache(namespace, storage, ::decodeFlagFromStorage, ::encodeFlagToStorage) } -internal fun transformVariantFromStorage(storageValue: String): Variant? { +internal fun decodeVariantFromStorage(storageValue: String): Variant? { return storageValue.toVariant() } -internal fun transformFlagFromStorage(storageValue: String): EvaluationFlag? { - return storageValue.toFlag() +internal fun decodeFlagFromStorage(storageValue: String): EvaluationFlag? { + return json.decodeFromString(storageValue) } -internal fun transformStringFromV(value: Any): String? { - return when (value) { - is Variant -> value.toJson() - is EvaluationFlag -> value.toJson() - else -> null - } +internal fun encodeVariantToStorage(value: Variant): String { + return value.toJson() } +internal fun encodeFlagToStorage(value: EvaluationFlag): String { + return json.encodeToString(value) +} diff --git a/sdk/src/main/java/com/amplitude/experiment/util/Flag.kt b/sdk/src/main/java/com/amplitude/experiment/util/Flag.kt deleted file mode 100644 index e1059bc..0000000 --- a/sdk/src/main/java/com/amplitude/experiment/util/Flag.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.amplitude.experiment.util - -import com.amplitude.experiment.evaluation.EvaluationFlag -import com.amplitude.experiment.evaluation.EvaluationSegment -import com.amplitude.experiment.evaluation.EvaluationVariant -import org.json.JSONException -import org.json.JSONObject - -internal fun String?.toFlag(): EvaluationFlag? { - return if (this == null) { - null - } else { - JSONObject(this).toFlag() - } -} - -internal fun EvaluationFlag.toJson(): String { - val jsonObject = JSONObject() - try { - jsonObject.put("key", key) - jsonObject.put("variants", variants) - jsonObject.put("segments", segments) - - if (dependencies != null) { - jsonObject.put("dependencies", dependencies) - } - if (metadata != null) { - jsonObject.put("metadata", metadata) - } - } catch (e: JSONException) { - Logger.w("Error converting Flag to json string", e) - } - return jsonObject.toString() -} - -internal fun JSONObject?.toFlag(): EvaluationFlag? { - return if (this == null) { - null - } else try { - val key = when { - has("key") -> getString("key") - else -> return null - } - val variants = getJSONObject("variants").toMap() as Map - - val segments = getJSONArray("segments").toList() as List - - val dependencies = when { - has("dependencies") -> getJSONArray("dependencies").toList() as Set - else -> null - } - - val metadata = when { - has("metadata") -> getJSONObject("metadata").toMap() - else -> null - } - EvaluationFlag(key, variants, segments, dependencies, metadata) - } catch (e: JSONException) { - Logger.w("Error parsing Flag from json string $this") - null - } -} diff --git a/sdk/src/test/java/com/amplitude/experiment/StorageTest.kt b/sdk/src/test/java/com/amplitude/experiment/StorageTest.kt index b5627ff..70f481a 100644 --- a/sdk/src/test/java/com/amplitude/experiment/StorageTest.kt +++ b/sdk/src/test/java/com/amplitude/experiment/StorageTest.kt @@ -1,6 +1,6 @@ package com.amplitude.experiment -import com.amplitude.experiment.storage.transformVariantFromStorage +import com.amplitude.experiment.storage.decodeVariantFromStorage import org.json.JSONObject import org.junit.Assert import org.junit.Test @@ -12,7 +12,7 @@ class TransformVariantFromStorageTest { val storedVariant = JSONObject(mapOf("value" to "on")).toString() Assert.assertEquals( Variant(key = "on", value = "on"), - transformVariantFromStorage(storedVariant) + decodeVariantFromStorage(storedVariant) ) } @@ -26,7 +26,7 @@ class TransformVariantFromStorageTest { ).toString() Assert.assertEquals( Variant(key = "on", value = "on", payload = mapOf("k" to "v")), - transformVariantFromStorage(storedVariant) + decodeVariantFromStorage(storedVariant) ) } @@ -47,7 +47,7 @@ class TransformVariantFromStorageTest { expKey = "exp-1", metadata = mapOf("experimentKey" to "exp-1") ), - transformVariantFromStorage(storedVariant) + decodeVariantFromStorage(storedVariant) ) } @@ -61,7 +61,7 @@ class TransformVariantFromStorageTest { ).toString() Assert.assertEquals( Variant(key = "treatment", value = "on"), - transformVariantFromStorage(storedVariant) + decodeVariantFromStorage(storedVariant) ) } @@ -80,7 +80,7 @@ class TransformVariantFromStorageTest { value = "on", payload = mapOf("k" to "v") ), - transformVariantFromStorage(storedVariant) + decodeVariantFromStorage(storedVariant) ) } @@ -102,7 +102,7 @@ class TransformVariantFromStorageTest { expKey = "exp-1", metadata = mapOf("experimentKey" to "exp-1") ), - transformVariantFromStorage(storedVariant) + decodeVariantFromStorage(storedVariant) ) } @@ -124,7 +124,7 @@ class TransformVariantFromStorageTest { expKey = "exp-1", metadata = mapOf("experimentKey" to "exp-1") ), - transformVariantFromStorage(storedVariant) + decodeVariantFromStorage(storedVariant) ) } }