Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-vd committed May 18, 2023
1 parent 47744b4 commit cda4e3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void onCorruption(SQLiteDatabase dbObj) {
}

private void deleteDatabaseFile(String fileName) {
if (fileName.equalsIgnoreCase(":memory:") || fileName.trim().length() == 0) {
if (fileName == null || fileName.equalsIgnoreCase(":memory:") || fileName.trim().length() == 0) {
Timber.e("Cannot delete database. Provided filename is not valid: %s", fileName);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void testOnCorruptionCallShouldCloseDatabaseObjectIfOpen(){

@Test
public void testOnCorruptionShouldDeleteCurrentDBFile() throws IOException {
SQLiteDatabase database = Mockito.mock(SQLiteDatabase.class);
SQLiteDatabase database = Mockito.mock(SQLiteDatabase.class, Mockito.CALLS_REAL_METHODS);
Mockito.doReturn(true).when(database).isOpen();

String dbPath = "src/test/assets/drishti.db";
Expand Down

0 comments on commit cda4e3c

Please sign in to comment.