Add missing unmockk calls in various unit tests.

This commit is contained in:
Cody Henthorne
2025-08-05 13:40:50 -04:00
parent 949bc8fb95
commit f8b18b6ea9
4 changed files with 17 additions and 1 deletions

View File

@@ -5,8 +5,10 @@ import io.mockk.every
import io.mockk.mockk import io.mockk.mockk
import io.mockk.mockkObject import io.mockk.mockkObject
import io.mockk.mockkStatic import io.mockk.mockkStatic
import io.mockk.unmockkAll
import io.mockk.verify import io.mockk.verify
import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.core.Single
import org.junit.After
import org.junit.Before import org.junit.Before
import org.junit.BeforeClass import org.junit.BeforeClass
import org.junit.Rule import org.junit.Rule
@@ -90,6 +92,11 @@ class SafetyNumberRepositoryTest {
every { Recipient.self() } returns recipientPool[0] every { Recipient.self() } returns recipientPool[0]
} }
@After
fun tearDown() {
unmockkAll()
}
/** /**
* Batch request for a current identity key should return an empty list and not perform any identity key updates. * Batch request for a current identity key should return an empty list and not perform any identity key updates.
*/ */

View File

@@ -10,7 +10,9 @@ import io.mockk.every
import io.mockk.mockk import io.mockk.mockk
import io.mockk.mockkObject import io.mockk.mockkObject
import io.mockk.mockkStatic import io.mockk.mockkStatic
import io.mockk.unmockkAll
import io.mockk.verify import io.mockk.verify
import org.junit.After
import org.junit.Before import org.junit.Before
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
@@ -95,6 +97,11 @@ class InAppPaymentRecurringContextJobTest {
} }
} }
@After
fun tearDown() {
unmockkAll()
}
@Test @Test
fun `Given user is unregistered, when I run then I expect failure`() { fun `Given user is unregistered, when I run then I expect failure`() {
every { mockSignalStore.account.isRegistered } returns true every { mockSignalStore.account.isRegistered } returns true

View File

@@ -6,6 +6,7 @@ import io.mockk.mockk
import io.mockk.mockkStatic import io.mockk.mockkStatic
import io.mockk.runs import io.mockk.runs
import io.mockk.slot import io.mockk.slot
import io.mockk.unmockkAll
import io.mockk.verify import io.mockk.verify
import io.reactivex.rxjava3.plugins.RxJavaPlugins import io.reactivex.rxjava3.plugins.RxJavaPlugins
import io.reactivex.rxjava3.schedulers.TestScheduler import io.reactivex.rxjava3.schedulers.TestScheduler
@@ -44,6 +45,7 @@ class StoriesTest {
@After @After
fun tearDown() { fun tearDown() {
RxJavaPlugins.reset() RxJavaPlugins.reset()
unmockkAll()
} }
@Test @Test

View File

@@ -131,7 +131,7 @@ class AudioDeviceConfigTest {
@After @After
fun tearDown() { fun tearDown() {
mockkStatic(AppDependencies::class) unmockkStatic(AppDependencies::class)
unmockkStatic(PackageManager::class) unmockkStatic(PackageManager::class)
unmockkObject(RemoteConfig) unmockkObject(RemoteConfig)
unmockkStatic(AcousticEchoCanceler::class) unmockkStatic(AcousticEchoCanceler::class)