Skip to content

Commit 4eed0a3

Browse files
committed
chore: replace wheneverBlocking
1 parent 39cd7a6 commit 4eed0a3

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import org.mockito.kotlin.any
1313
import org.mockito.kotlin.anyOrNull
1414
import org.mockito.kotlin.mock
1515
import org.mockito.kotlin.whenever
16-
import org.mockito.kotlin.wheneverBlocking
1716
import to.bitkit.data.AppCacheData
1817
import to.bitkit.data.CacheStore
1918
import to.bitkit.data.SettingsData
@@ -93,17 +92,17 @@ class AppViewModelSendFlowTest : BaseUnitTest() {
9392
whenever(transferRepo.activeTransfers).thenReturn(flowOf(emptyList()))
9493
whenever(timedSheetManager.currentSheet).thenReturn(MutableStateFlow(null))
9594
whenever(migrationService.isShowingMigrationLoading).thenReturn(MutableStateFlow(false))
96-
wheneverBlocking { migrationService.needsPostMigrationSync() }.thenReturn(false)
97-
wheneverBlocking { migrationService.isMigrationChecked() }.thenReturn(true)
98-
wheneverBlocking { widgetsRepo.refreshEnabledWidgets() }.thenReturn(Unit)
99-
wheneverBlocking { lightningRepo.updateGeoBlockState() }.thenReturn(Unit)
100-
wheneverBlocking { currencyRepo.convertSatsToFiat(any(), anyOrNull()) }
95+
whenever { migrationService.needsPostMigrationSync() }.thenReturn(false)
96+
whenever { migrationService.isMigrationChecked() }.thenReturn(true)
97+
whenever { widgetsRepo.refreshEnabledWidgets() }.thenReturn(Unit)
98+
whenever { lightningRepo.updateGeoBlockState() }.thenReturn(Unit)
99+
whenever { currencyRepo.convertSatsToFiat(any(), anyOrNull()) }
101100
.thenReturn(Result.failure(Exception("not mocked")))
102-
wheneverBlocking { lightningRepo.calculateTotalFee(any(), anyOrNull(), any(), anyOrNull(), anyOrNull()) }
101+
whenever { lightningRepo.calculateTotalFee(any(), anyOrNull(), any(), anyOrNull(), anyOrNull()) }
103102
.thenReturn(Result.success(100uL))
104-
wheneverBlocking { lightningRepo.getFeeRateForSpeed(any(), anyOrNull()) }
103+
whenever { lightningRepo.getFeeRateForSpeed(any(), anyOrNull()) }
105104
.thenReturn(Result.success(2u))
106-
wheneverBlocking { lightningRepo.canSend(any(), any()) }.thenReturn(true)
105+
whenever { lightningRepo.canSend(any(), any()) }.thenReturn(true)
107106

108107
sut = AppViewModel(
109108
connectivityRepo = connectivityRepo,

0 commit comments

Comments
 (0)