@@ -12,7 +12,6 @@ import org.junit.Test
1212import org.lightningdevkit.ldknode.PaymentDetails
1313import org.mockito.kotlin.any
1414import org.mockito.kotlin.doReturn
15- import org.mockito.kotlin.eq
1615import org.mockito.kotlin.mock
1716import org.mockito.kotlin.never
1817import org.mockito.kotlin.verify
@@ -32,12 +31,13 @@ import kotlin.test.assertTrue
3231
3332class ActivityRepoTest : BaseUnitTest () {
3433
35- private val coreService: CoreService = mock()
36- private val lightningRepo: LightningRepo = mock()
37- private val cacheStore: CacheStore = mock()
38- private val addressChecker: AddressChecker = mock()
39- private val db: AppDb = mock()
40- private val clock: Clock = mock()
34+ private val coreService = mock<CoreService >()
35+ private val lightningRepo = mock<LightningRepo >()
36+ private val transferRepo = mock<TransferRepo >()
37+ private val cacheStore = mock<CacheStore >()
38+ private val addressChecker = mock<AddressChecker >()
39+ private val db = mock<AppDb >()
40+ private val clock = mock<Clock >()
4141
4242 private lateinit var sut: ActivityRepo
4343
@@ -66,7 +66,7 @@ class ActivityRepoTest : BaseUnitTest() {
6666 cacheStore = cacheStore,
6767 addressChecker = addressChecker,
6868 db = db,
69- transferRepo = mock() ,
69+ transferRepo = transferRepo ,
7070 clock = clock,
7171 )
7272 }
@@ -76,13 +76,15 @@ class ActivityRepoTest : BaseUnitTest() {
7676 val payments = listOf (testPaymentDetails)
7777 wheneverBlocking { lightningRepo.getPayments() }.thenReturn(Result .success(payments))
7878 wheneverBlocking { coreService.activity.getActivity(any()) }.thenReturn(null )
79- wheneverBlocking { coreService.activity.syncLdkNodePaymentsToActivities(any(), eq(false )) }.thenReturn(Unit )
79+ wheneverBlocking { coreService.activity.syncLdkNodePaymentsToActivities(payments) }.thenReturn(Unit )
80+ wheneverBlocking { transferRepo.syncTransferStates() }.thenReturn(Result .success(Unit ))
81+ wheneverBlocking { coreService.activity.allPossibleTags() }.thenReturn(emptyList())
8082
8183 val result = sut.syncActivities()
8284
8385 assertTrue(result.isSuccess)
8486 verify(lightningRepo).getPayments()
85- verify(coreService.activity).syncLdkNodePaymentsToActivities(payments, forceUpdate = false )
87+ verify(coreService.activity).syncLdkNodePaymentsToActivities(payments)
8688 assertFalse(sut.isSyncingLdkNodePayments.value)
8789 }
8890
0 commit comments