Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Bug 1847999 - Switch to using non-deprecated constructor for Migratio…
Browse files Browse the repository at this point in the history
…nTestHelper.
  • Loading branch information
mcarare committed Feb 12, 2024
1 parent 0daebd8 commit 62662cd
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package mozilla.components.feature.downloads
import android.content.Context
import androidx.room.Room
import androidx.room.testing.MigrationTestHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
import androidx.test.core.app.ApplicationProvider
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand All @@ -32,11 +31,9 @@ class OnDeviceDownloadStorageTest {
private lateinit var database: DownloadsDatabase

@get:Rule
@Suppress("DEPRECATION")
val helper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
DownloadsDatabase::class.java.canonicalName,
FrameworkSQLiteOpenHelperFactory(),
DownloadsDatabase::class.java,
)

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.content.Context
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.room.Room
import androidx.room.testing.MigrationTestHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
import androidx.test.core.app.ApplicationProvider
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.flow.first
Expand Down Expand Up @@ -37,11 +36,9 @@ class LoginExceptionStorageTest {
var instantTaskExecutorRule = InstantTaskExecutorRule()

@get:Rule
@Suppress("DEPRECATION")
val helper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
LoginExceptionStorage::class.java.canonicalName,
FrameworkSQLiteOpenHelperFactory(),
LoginExceptionDatabase::class.java,
)

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package mozilla.components.feature.pwa.db

import androidx.core.database.getStringOrNull
import androidx.room.testing.MigrationTestHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
Expand All @@ -20,11 +19,9 @@ class ManifestDatabaseMigrationTest {

@Rule
@JvmField
@Suppress("DEPRECATION")
val helper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
ManifestDatabase::class.java.canonicalName,
FrameworkSQLiteOpenHelperFactory(),
ManifestDatabase::class.java,
)

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.content.Context
import androidx.core.net.toUri
import androidx.room.Room
import androidx.room.testing.MigrationTestHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
import androidx.test.core.app.ApplicationProvider
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.test.runTest
Expand All @@ -34,11 +33,9 @@ class OnDeviceSitePermissionsStorageTest {
private lateinit var database: SitePermissionsDatabase

@get:Rule
@Suppress("DEPRECATION")
val helper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
SitePermissionsDatabase::class.java.canonicalName,
FrameworkSQLiteOpenHelperFactory(),
SitePermissionsDatabase::class.java,
)

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.content.Context
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.room.Room
import androidx.room.testing.MigrationTestHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
import androidx.test.core.app.ApplicationProvider
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand Down Expand Up @@ -38,11 +37,9 @@ class OnDevicePinnedSitesStorageTest {
var instantTaskExecutorRule = InstantTaskExecutorRule()

@get:Rule
@Suppress("DEPRECATION")
val helper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
TopSiteDatabase::class.java.canonicalName,
FrameworkSQLiteOpenHelperFactory(),
TopSiteDatabase::class.java,
)

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.content.Context
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.room.Room
import androidx.room.testing.MigrationTestHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
import androidx.test.core.app.ApplicationProvider
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.runBlocking
Expand All @@ -31,11 +30,9 @@ class PocketRecommendationsDatabaseTest {
private lateinit var database: PocketRecommendationsDatabase

@get:Rule
@Suppress("DEPRECATION")
val helper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
PocketRecommendationsDatabase::class.java.canonicalName,
FrameworkSQLiteOpenHelperFactory(),
PocketRecommendationsDatabase::class.java,
)

@get:Rule
Expand Down

0 comments on commit 62662cd

Please sign in to comment.