Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-03 19:57:47 +04:00
parent 3cc0a643e9
commit 642190f7c6
98 changed files with 317 additions and 202 deletions

View file

@ -38,7 +38,6 @@ dependencies {
/** Testing libraries */
testRuntimeOnly(deps.test.junit5.engine)
testRuntimeOnly(deps.test.junit5.vintage.engine)
testImplementation(projects.common.test)
testImplementation(projects.test.core)
}

View file

@ -2,8 +2,8 @@ package com.tangem.domain.card.configs
import com.tangem.blockchain.common.Blockchain
import com.tangem.common.card.EllipticCurve
import junit.framework.TestCase.assertEquals
import org.junit.Test
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
class Wallet2CardConfigTest {

View file

@ -12,7 +12,12 @@ dependencies {
implementation(deps.kotlin.serialization)
testImplementation(deps.test.coroutine)
testImplementation(deps.test.junit)
testImplementation(deps.test.junit5)
testRuntimeOnly(deps.test.junit5.engine)
testImplementation(deps.test.mockk)
testImplementation(deps.test.truth)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

View file

@ -8,7 +8,7 @@ import io.mockk.mockk
import io.mockk.verify
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.jupiter.api.Test
/**
[REDACTED_AUTHOR]

View file

@ -16,8 +16,14 @@ dependencies {
implementation(deps.kotlin.coroutines)
implementation(deps.arrow.core)
testImplementation(deps.test.junit)
testImplementation(deps.test.junit5)
testRuntimeOnly(deps.test.junit5.engine)
testImplementation(deps.test.coroutine)
testImplementation(deps.test.truth)
testImplementation(deps.test.mockk)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

View file

@ -10,7 +10,7 @@ import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.jupiter.api.Test
import java.util.concurrent.TimeUnit
class CheckHotWalletUpgradeBannerUseCaseTest {

View file

@ -8,7 +8,7 @@ import io.mockk.coEvery
import io.mockk.coVerify
import io.mockk.mockk
import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.jupiter.api.Test
class CloseHotWalletUpgradeBannerUseCaseTest {

View file

@ -4,7 +4,7 @@ import com.google.common.truth.Truth
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchainsdk.utils.fromNetworkId
import com.tangem.blockchainsdk.utils.toNetworkId
import org.junit.Test
import org.junit.jupiter.api.Test
class BlockchainTests {
@Test

View file

@ -31,7 +31,12 @@ dependencies {
testImplementation(projects.core.pagination)
/* Tests */
testImplementation(deps.test.junit)
testImplementation(deps.test.junit5)
testRuntimeOnly(deps.test.junit5.engine)
testImplementation(deps.test.coroutine)
testImplementation(deps.test.truth)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

View file

@ -3,7 +3,7 @@ package com.tangem.domain.managetokens
import com.tangem.domain.managetokens.model.ManagedCryptoCurrency
import com.tangem.utils.coroutines.TestingCoroutineDispatcherProvider
import com.tangem.pagination.Batch
import org.junit.Test
import org.junit.jupiter.api.Test
import java.util.UUID
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.test.runTest

View file

@ -25,9 +25,14 @@ dependencies {
// end
// region Tests
testImplementation(deps.test.junit)
testImplementation(deps.test.junit5)
testRuntimeOnly(deps.test.junit5.engine)
testImplementation(deps.test.coroutine)
testImplementation(deps.test.truth)
testImplementation(deps.test.mockk)
// end
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

View file

@ -10,7 +10,7 @@ import io.mockk.coVerifyOrder
import io.mockk.mockk
import kotlinx.coroutines.*
import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.jupiter.api.Test
import java.net.SocketTimeoutException
class GetApplicationIdUseCaseTest {

View file

@ -10,8 +10,8 @@ import io.mockk.coEvery
import io.mockk.coVerify
import io.mockk.mockk
import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Test
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
class SendPushTokenUseCaseTest {
@ -19,7 +19,7 @@ class SendPushTokenUseCaseTest {
private lateinit var pushNotificationsTokenProvider: PushNotificationsTokenProvider
private lateinit var sendPushTokenUseCase: SendPushTokenUseCase
@Before
@BeforeEach
fun setup() {
pushNotificationsRepository = mockk()
pushNotificationsTokenProvider = mockk()

View file

@ -31,7 +31,12 @@ dependencies {
implementation(deps.jodatime)
/** Tests */
testImplementation(deps.test.junit)
testImplementation(deps.test.junit5)
testRuntimeOnly(deps.test.junit5.engine)
testImplementation(deps.test.truth)
testImplementation(deps.test.mockk)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

View file

@ -2,7 +2,7 @@ package com.tangem.domain.swap.usecase
import com.google.common.truth.Truth.assertThat
import com.tangem.domain.swap.models.PredefinedPercentAmount
import org.junit.Test
import org.junit.jupiter.api.Test
import java.math.BigDecimal
class CalculateAmountUseCaseTest {

View file

@ -45,4 +45,8 @@ dependencies {
testImplementation(projects.common.test)
testImplementation(projects.test.core)
testImplementation(projects.test.mock)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

View file

@ -18,9 +18,9 @@ import io.mockk.mockk
import io.mockk.mockkObject
import io.mockk.unmockkObject
import kotlinx.coroutines.test.runTest
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
internal class ValidateWalletAddressUseCaseTest {
@ -34,14 +34,14 @@ internal class ValidateWalletAddressUseCaseTest {
private val userWalletId: UserWalletId = mockk()
private val network: Network = mockk()
@Before
@BeforeEach
fun setUp() {
mockkObject(BlockchainUtils)
every { BlockchainUtils.decodeRippleXAddress(any(), any()) } returns null
every { network.rawId } returns "ethereum"
}
@After
@AfterEach
fun tearDown() {
unmockkObject(BlockchainUtils)
}

View file

@ -22,9 +22,9 @@ import io.mockk.coVerify
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.test.runTest
import org.junit.Assert.*
import org.junit.Before
import org.junit.Test
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import java.math.BigDecimal
import java.math.BigInteger
@ -45,7 +45,7 @@ class TokenFeeCalculatorTest {
private lateinit var mockUserWalletId: UserWalletId
private lateinit var mockTransactionData: TransactionData
@Before
@BeforeEach
fun setup() {
walletManagersFacade = mockk()
gaslessTransactionRepository = mockk()

View file

@ -59,9 +59,14 @@ dependencies {
// end
// region Tests
testImplementation(deps.test.junit)
testImplementation(deps.test.junit5)
testRuntimeOnly(deps.test.junit5.engine)
testImplementation(deps.test.coroutine)
testImplementation(deps.test.truth)
testImplementation(deps.test.mockk)
// end
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

View file

@ -11,8 +11,8 @@ import io.mockk.just
import io.mockk.mockk
import io.mockk.runs
import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Test
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
class SetNotificationsEnabledUseCaseTest {
@ -20,7 +20,7 @@ class SetNotificationsEnabledUseCaseTest {
private lateinit var walletsRepository: WalletsRepository
private lateinit var accountsCRUDRepository: AccountsCRUDRepository
@Before
@BeforeEach
fun setup() {
walletsRepository = mockk()
accountsCRUDRepository = mockk()

View file

@ -17,8 +17,8 @@ import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Test
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
class UpdateRemoteWalletsInfoUseCaseTest {
@ -28,7 +28,7 @@ class UpdateRemoteWalletsInfoUseCaseTest {
private lateinit var userWalletListRepository: UserWalletsListRepository
private lateinit var generateWalletNameUseCase: GenerateWalletNameUseCase
@Before
@BeforeEach
fun setup() {
walletsRepository = mockk()
userWalletsSyncDelegate = mockk()