fun migrationFrom1To2_containsCorrectDataTest() { // Create the database with the initial version 1 schema and insert a user val id = SqliteDatabaseTestHelper.insertUser(User, sqliteTestDbHelper) migrationTestHelper.runMigrationsAndValidate(TEST_DB_NAME, 2, true, Migration1To2()) // Get the latest, migrated, version of the database val latestDb = migratedRoomDatabase // Check that the correct data is in the database latestDb.userDao().getUserById(id.toInt()) .test() .awaitDone(5, TimeUnit.SECONDS) .assertValue { (_, userName) -> userName.equals(USER.userName) } }