mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
updated database version and added associated tests
This commit is contained in:
parent
ab4fca5ea9
commit
1b86726364
2 changed files with 10 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ import fr.free.nrw.commons.modifications.ModifierSequenceDao;
|
|||
public class DBOpenHelper extends SQLiteOpenHelper {
|
||||
|
||||
private static final String DATABASE_NAME = "commons.db";
|
||||
private static final int DATABASE_VERSION = 9;
|
||||
private static final int DATABASE_VERSION = 10;
|
||||
|
||||
/**
|
||||
* Do not use directly - @Inject an instance where it's needed and let
|
||||
|
|
|
|||
|
|
@ -126,6 +126,15 @@ class ContributionDaoTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun migrateTableVersionFrom_v9_to_v10() {
|
||||
Table.onUpdate(database, 8, 9)
|
||||
// Table changed in version 9
|
||||
inOrder(database) {
|
||||
verify<SQLiteDatabase>(database).execSQL(Table.ADD_WIKI_DATA_ENTITY_ID_FIELD)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun saveNewContribution_nonNullFields() {
|
||||
whenever(client.insert(isA(), isA())).thenReturn(contentUri)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue