Mock openAndTruncateStream instead of getStream in test

This commit is contained in:
Stypox 2024-11-27 16:37:25 +01:00
parent b21981a9c7
commit e31a8ad7a2
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class ImportExportManagerTest {
`when`(sharedPreferences.all).thenReturn(expectedPreferences) `when`(sharedPreferences.all).thenReturn(expectedPreferences)
val output = File.createTempFile("newpipe_", "") val output = File.createTempFile("newpipe_", "")
`when`(storedFileHelper.stream).thenReturn(FileStream(output)) `when`(storedFileHelper.openAndTruncateStream()).thenReturn(FileStream(output))
ImportExportManager(fileLocator).exportDatabase(sharedPreferences, storedFileHelper) ImportExportManager(fileLocator).exportDatabase(sharedPreferences, storedFileHelper)
val zipFile = ZipFile(output) val zipFile = ZipFile(output)