fix tests
This commit is contained in:
parent
5306e62f91
commit
9b8632239c
2 changed files with 4 additions and 2 deletions
|
@ -35,8 +35,10 @@ open class TestBase {
|
|||
fun setupLocale() {
|
||||
Locale.setDefault(Locale.ENGLISH)
|
||||
System.setProperty("disableFirebase", "true")
|
||||
}
|
||||
|
||||
// Initialize WorkManager for instrumentation tests.
|
||||
fun initWorkManager() {
|
||||
WorkManagerTestInitHelper.initializeTestWorkManager(
|
||||
context,
|
||||
Configuration.Builder()
|
||||
|
@ -44,7 +46,6 @@ open class TestBase {
|
|||
.setExecutor(SynchronousExecutor())
|
||||
.build()
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
// Workaround for Kotlin nullability.
|
||||
|
|
|
@ -90,6 +90,7 @@ internal class LoadBgWorkerTest : TestBase() {
|
|||
|
||||
@Test
|
||||
fun doWork() = runTest {
|
||||
initWorkManager()
|
||||
nsClientV3Plugin.nsAndroidClient = nsAndroidClient
|
||||
sut = TestListenableWorkerBuilder<LoadBgWorker>(context).build()
|
||||
Mockito.`when`(nsAndroidClient.getSgvsNewerThan(anyLong(), anyLong())).thenReturn(NSAndroidClient.ReadResponse(200, 0, emptyList()))
|
||||
|
|
Loading…
Reference in a new issue