diff --git a/vector/src/test/java/im/vector/app/features/location/domain/usecase/CompareLocationsUseCaseTest.kt b/vector/src/test/java/im/vector/app/features/location/domain/usecase/CompareLocationsUseCaseTest.kt index 7a80cbe87e..da3234cfd1 100644 --- a/vector/src/test/java/im/vector/app/features/location/domain/usecase/CompareLocationsUseCaseTest.kt +++ b/vector/src/test/java/im/vector/app/features/location/domain/usecase/CompareLocationsUseCaseTest.kt @@ -16,21 +16,16 @@ package im.vector.app.features.location.domain.usecase -import com.airbnb.mvrx.test.MvRxTestRule import im.vector.app.features.location.LocationData import im.vector.app.test.fakes.FakeSession import io.mockk.MockKAnnotations import io.mockk.impl.annotations.OverrideMockKs import kotlinx.coroutines.test.runTest import org.junit.Before -import org.junit.Rule import org.junit.Test class CompareLocationsUseCaseTest { - @get:Rule - val mvRxTestRule = MvRxTestRule() - private val session = FakeSession() @OverrideMockKs diff --git a/vector/src/test/java/im/vector/app/features/media/domain/usecase/DownloadMediaUseCaseTest.kt b/vector/src/test/java/im/vector/app/features/media/domain/usecase/DownloadMediaUseCaseTest.kt index d45e6e7ce1..87dbabee0a 100644 --- a/vector/src/test/java/im/vector/app/features/media/domain/usecase/DownloadMediaUseCaseTest.kt +++ b/vector/src/test/java/im/vector/app/features/media/domain/usecase/DownloadMediaUseCaseTest.kt @@ -19,7 +19,6 @@ package im.vector.app.features.media.domain.usecase import android.content.Context import android.net.Uri import androidx.core.net.toUri -import com.airbnb.mvrx.test.MvRxTestRule import im.vector.app.core.intent.getMimeTypeFromUri import im.vector.app.core.utils.saveMedia import im.vector.app.features.notifications.NotificationUtils @@ -42,14 +41,10 @@ import io.mockk.verifyAll import kotlinx.coroutines.test.runTest import org.junit.After import org.junit.Before -import org.junit.Rule import org.junit.Test class DownloadMediaUseCaseTest { - @get:Rule - val mvRxTestRule = MvRxTestRule() - @MockK lateinit var appContext: Context diff --git a/vector/src/test/java/im/vector/app/test/TestCoroutineDispatchers.kt b/vector/src/test/java/im/vector/app/test/TestCoroutineDispatchers.kt index bf24d146e6..fb3c1bb70a 100644 --- a/vector/src/test/java/im/vector/app/test/TestCoroutineDispatchers.kt +++ b/vector/src/test/java/im/vector/app/test/TestCoroutineDispatchers.kt @@ -16,13 +16,15 @@ package im.vector.app.test -import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.test.UnconfinedTestDispatcher import org.matrix.android.sdk.api.MatrixCoroutineDispatchers +private val testDispatcher = UnconfinedTestDispatcher() + internal val testCoroutineDispatchers = MatrixCoroutineDispatchers( - io = Dispatchers.Main, - computation = Dispatchers.Main, - main = Dispatchers.Main, - crypto = Dispatchers.Main, - dmVerif = Dispatchers.Main + io = testDispatcher, + computation = testDispatcher, + main = testDispatcher, + crypto = testDispatcher, + dmVerif = testDispatcher )