From e31a8ad7a2e983e06236fd9692d71f472926f0fd Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 27 Nov 2024 16:37:25 +0100 Subject: [PATCH] Mock openAndTruncateStream instead of getStream in test --- .../java/org/schabi/newpipe/settings/ImportExportManagerTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/test/java/org/schabi/newpipe/settings/ImportExportManagerTest.kt b/app/src/test/java/org/schabi/newpipe/settings/ImportExportManagerTest.kt index a524f64f3..5b8023561 100644 --- a/app/src/test/java/org/schabi/newpipe/settings/ImportExportManagerTest.kt +++ b/app/src/test/java/org/schabi/newpipe/settings/ImportExportManagerTest.kt @@ -55,7 +55,7 @@ class ImportExportManagerTest { `when`(sharedPreferences.all).thenReturn(expectedPreferences) val output = File.createTempFile("newpipe_", "") - `when`(storedFileHelper.stream).thenReturn(FileStream(output)) + `when`(storedFileHelper.openAndTruncateStream()).thenReturn(FileStream(output)) ImportExportManager(fileLocator).exportDatabase(sharedPreferences, storedFileHelper) val zipFile = ZipFile(output)