diff --git a/omniNotes/src/androidTest/java/it/feio/android/omninotes/async/upgrade/UpgradeProcessorTest.kt b/omniNotes/src/androidTest/java/it/feio/android/omninotes/async/upgrade/UpgradeProcessorTest.kt index 01571324c..3f9c4054a 100644 --- a/omniNotes/src/androidTest/java/it/feio/android/omninotes/async/upgrade/UpgradeProcessorTest.kt +++ b/omniNotes/src/androidTest/java/it/feio/android/omninotes/async/upgrade/UpgradeProcessorTest.kt @@ -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" }); } } diff --git a/omniNotes/src/androidTest/java/it/feio/android/omninotes/helpers/BackupHelperTest.java b/omniNotes/src/androidTest/java/it/feio/android/omninotes/helpers/BackupHelperTest.java index f4ad30dd0..65e28c707 100644 --- a/omniNotes/src/androidTest/java/it/feio/android/omninotes/helpers/BackupHelperTest.java +++ b/omniNotes/src/androidTest/java/it/feio/android/omninotes/helpers/BackupHelperTest.java @@ -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 @@ -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); }