mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-20 11:08:31 +00:00
Add missing unmockk calls in various unit tests.
This commit is contained in:
@@ -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.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user