Fix test by mocking WorkManagerProvider.tag

Appeared when upgrading androidx.work:work-runtime-ktx from 2.7.1 to 2.8.0 in #8099
This commit is contained in:
Benoit Marty 2023-03-03 18:01:10 +01:00
parent 8bb78ce68b
commit ceda85f624
2 changed files with 2 additions and 1 deletions

View file

@ -41,7 +41,7 @@ internal class WorkManagerProvider @Inject constructor(
private val coroutineDispatchers: MatrixCoroutineDispatchers, private val coroutineDispatchers: MatrixCoroutineDispatchers,
private val sessionScope: CoroutineScope private val sessionScope: CoroutineScope
) { ) {
private val tag = MATRIX_SDK_TAG_PREFIX + sessionId val tag = MATRIX_SDK_TAG_PREFIX + sessionId
val workManager = WorkManager.getInstance(context) val workManager = WorkManager.getInstance(context)

View file

@ -26,5 +26,6 @@ internal class FakeWorkManagerProvider(
val instance = mockk<WorkManagerProvider>().also { val instance = mockk<WorkManagerProvider>().also {
every { it.workManager } returns fakeWorkManager.instance every { it.workManager } returns fakeWorkManager.instance
every { it.tag } returns "Tag"
} }
} }