Skip to content

Commit

Permalink
Fixed some tests broken during Java streams refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
federicoiosue committed Aug 24, 2024
1 parent 1217aff commit 1e6124f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class UpgradeProcessorTest : BaseAndroidTestCase() {
note.attachmentsList[0] = attachment
dbHelper.updateNote(note, false)

assertFalse(Stream.of(dbHelper.allAttachments).allMatch { a -> a.single().uri.scheme != "content" });
assertFalse(dbHelper.allAttachments.stream().allMatch { a -> a.uri.scheme != "content" });

UpgradeProcessor.process(624, 625)

assertTrue(Stream.of(dbHelper.allAttachments).allMatch { a -> a.single().uri.scheme != "content" });
assertTrue(dbHelper.allAttachments.stream().allMatch { a -> a.uri.scheme != "content" });
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void exportNotes() throws IOException {

assertTrue(backupDir.exists());
assertTrue(backupDir.findFile(".nomedia").exists());
assertEquals(5, backupDir.listFiles().size());
assertEquals(4, backupDir.listFiles().size());
}

@Test
Expand All @@ -116,7 +116,7 @@ public void exportNote() {
.filter(f -> f.getName().matches("\\d{13}.json"))
.collect(Collectors.toList());
assertEquals(1, noteFiles.size());
var retrievedNote = noteFiles.stream().map(BackupHelper::importNote).collect(Collectors.toList());
var retrievedNote = noteFiles.stream().map(BackupHelper::importNote).findFirst().get();
assertEquals(note, retrievedNote);
}

Expand Down

0 comments on commit 1e6124f

Please sign in to comment.