79187428

Date: 2024-11-14 04:49:02
Score: 0.5
Natty:
Report link

It turns out that we don't have to specify the AutoMigration classes anymore in the runMigrationsAndValidate method. It is applied automatically to the database just like it is done in the real application database.

@get:Rule
    val helper: MigrationTestHelper = MigrationTestHelper(
        InstrumentationRegistry.getInstrumentation(),
        Database::class.java,
    )

...

@Test
fun testAutoMigration() {
db = helper.runMigrationsAndValidate(TEST_DB, 2, true)
// verify
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Sundara Raghavan