mirror of
https://github.com/bitwarden/android.git
synced 2025-12-10 20:07:59 -06:00
Fixed ServerConfigRepo tests
This commit is contained in:
parent
3a75ba5110
commit
88e23a4130
@ -57,7 +57,6 @@ internal class ServerConfigRepositoryImpl(
|
||||
|
||||
Log.d("ServerConfigRepository", "Will check for flags")
|
||||
if (featureStatesMap != null) {
|
||||
// Option 3: Specifically print the value for "enable-pm-bwa-sync"
|
||||
val specificValue = featureStatesMap["enable-pm-bwa-sync"]
|
||||
if (specificValue != null) {
|
||||
Log.d(
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.bitwarden.data.repository
|
||||
|
||||
import android.util.Log
|
||||
import app.cash.turbine.test
|
||||
import com.bitwarden.core.data.util.asSuccess
|
||||
import com.bitwarden.data.datasource.disk.base.FakeDispatcherManager
|
||||
@ -11,9 +12,13 @@ import com.bitwarden.network.model.ConfigResponseJson.EnvironmentJson
|
||||
import com.bitwarden.network.model.ConfigResponseJson.ServerJson
|
||||
import com.bitwarden.network.service.ConfigService
|
||||
import io.mockk.coEvery
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import io.mockk.mockkStatic
|
||||
import io.mockk.unmockkStatic
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
import org.junit.jupiter.api.AfterEach
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Assertions.assertNotEquals
|
||||
import org.junit.jupiter.api.Assertions.assertNull
|
||||
@ -47,6 +52,15 @@ class ServerConfigRepositoryTest {
|
||||
@BeforeEach
|
||||
fun setUp() {
|
||||
fakeConfigDiskSource.serverConfig = null
|
||||
|
||||
mockkStatic(Log::class)
|
||||
every { Log.d(any(), any()) } returns 1
|
||||
every { Log.d(any(), any(), any()) } returns 1
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
fun tearDown() {
|
||||
unmockkStatic(Log::class)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user