FakeRemoteConfigClient

class FakeRemoteConfigClient(overrides: Map<ConfigKey, ConfigValue> = emptyMap(), keys: List<ConfigKey>? = null) : RemoteConfigClient

In-memory RemoteConfigClient fake seeded with fixed values, for consumer unit tests.

Parameters

overrides

values returned instead of each key's default; mutate later with set/clear.

keys

the key registry reported by allValues. Defaults to the seeded keys only; pass the app's full ALL_KEYS to also see un-overridden keys (reported with ValueSource.DEFAULT).

Constructors

Link copied to clipboard
constructor(overrides: Map<ConfigKey, ConfigValue> = emptyMap(), keys: List<ConfigKey>? = null)

Properties

Functions

Link copied to clipboard
open override fun allValues(): List<ResolvedConfigEntry>
Link copied to clipboard
fun clear(key: ConfigKey)

Reverts key to its compiled-in default.

Link copied to clipboard
open suspend override fun fetchAndActivate()
Link copied to clipboard
fun set(key: ConfigKey, value: ConfigValue)

Replaces the value returned for key; rejects values of the wrong type.

Link copied to clipboard
open override fun value(key: ConfigKey): ConfigValue