diff --git a/library/src/main/java/com/schibsted/spain/barista/rule/cleardata/internal/DatabaseOperations.kt b/library/src/main/java/com/schibsted/spain/barista/rule/cleardata/internal/DatabaseOperations.kt index 64d7ee005..d14c7b003 100644 --- a/library/src/main/java/com/schibsted/spain/barista/rule/cleardata/internal/DatabaseOperations.kt +++ b/library/src/main/java/com/schibsted/spain/barista/rule/cleardata/internal/DatabaseOperations.kt @@ -5,9 +5,9 @@ import androidx.test.platform.app.InstrumentationRegistry import java.io.File import java.util.ArrayList -class DatabaseOperations { +open class DatabaseOperations { - fun getAllDatabaseFiles(): List { + open fun getAllDatabaseFiles(): List { return InstrumentationRegistry.getInstrumentation().targetContext .let { context -> context.databaseList() @@ -16,14 +16,14 @@ class DatabaseOperations { } } - fun openDatabase(databaseFile: File): SQLiteDatabase { + open fun openDatabase(databaseFile: File): SQLiteDatabase { return SQLiteDatabase.openDatabase( databaseFile.absolutePath, null /* cursorFactory */, 0 /* flags */) } - fun getTableNames(sqLiteDatabase: SQLiteDatabase): List { + open fun getTableNames(sqLiteDatabase: SQLiteDatabase): List { sqLiteDatabase.rawQuery("SELECT name FROM sqlite_master WHERE type IN (?, ?)", arrayOf("table", "view")) .use { cursor -> val tableNames = ArrayList() @@ -34,7 +34,7 @@ class DatabaseOperations { } } - fun deleteTableContent(sqLiteDatabase: SQLiteDatabase, tableName: String) { + open fun deleteTableContent(sqLiteDatabase: SQLiteDatabase, tableName: String) { sqLiteDatabase.delete(tableName, null, null) } -} \ No newline at end of file +}