Skip to content

Commit 9c6e9bd

Browse files
ashishkumar468maskaravivek
authored andcommitted
updated test cases to support db upgrade in commons-app#2476 (commons-app#2497)
* updated test cases to support db upgrade in commons-app#2476 * fixed errors
1 parent cd145ef commit 9c6e9bd

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

app/src/test/kotlin/fr/free/nrw/commons/contributions/ContributionDaoTest.kt

+9-5
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,19 @@ class ContributionDaoTest {
108108
@Test
109109
fun migrateTableVersionFrom_v6_to_v7() {
110110
Table.onUpdate(database, 6, 7)
111-
// Table didn't change in version 7
112-
verifyZeroInteractions(database)
111+
// Table has changed in version 7
112+
inOrder(database) {
113+
verify<SQLiteDatabase>(database).execSQL(Table.ADD_WIKI_DATA_ENTITY_ID_FIELD)
114+
}
113115
}
114116

115117
@Test
116118
fun migrateTableVersionFrom_v7_to_v8() {
117119
Table.onUpdate(database, 7, 8)
118-
// Table didn't change in version 8
119-
verifyZeroInteractions(database)
120+
// Table has changed in version 8
121+
inOrder(database) {
122+
verify<SQLiteDatabase>(database).execSQL(Table.ADD_WIKI_DATA_ENTITY_ID_FIELD)
123+
}
120124
}
121125

122126
@Test
@@ -355,4 +359,4 @@ class ContributionDaoTest {
355359
contribution.wikiDataEntityId = "Q1"
356360
return contribution
357361
}
358-
}
362+
}

0 commit comments

Comments
 (0)