packages/apps/Settings: remove usages of deprecated Mockito matchers

Upstream Mockito has deleted the deprecated matchers
in the latest version. Migrate usage to replacements
to unblock upgrade.

Test: m checkbuild
Flag: TEST_ONLY
Bug: 310268946
Change-Id: I18160e93912d136f3962e3379a68ba2be82c1c78
This commit is contained in:
Adrian Roos
2025-03-13 09:54:49 +01:00
parent a7a7482118
commit 693035ab86
2 changed files with 4 additions and 5 deletions

View File

@@ -25,7 +25,6 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.kotlin.any
import org.mockito.kotlin.anyVararg
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.doThrow
import org.mockito.kotlin.eq
@@ -106,7 +105,7 @@ class CarrierConfigRepositoryTest {
@Test
fun transformConfig_managerThrowIllegalStateException_returnDefaultValue() {
mockCarrierConfigManager.stub {
on { getConfigForSubId(any(), anyVararg()) } doThrow IllegalStateException()
on { getConfigForSubId(any(), any()) } doThrow IllegalStateException()
}
val carrierName =
@@ -132,7 +131,7 @@ class CarrierConfigRepositoryTest {
repository.transformConfig(SUB_ID) { getString(key) }
repository.transformConfig(SUB_ID) { getString(key) }
verify(mockCarrierConfigManager, times(1)).getConfigForSubId(any(), anyVararg())
verify(mockCarrierConfigManager, times(1)).getConfigForSubId(any(), any())
}
@Test

View File

@@ -30,7 +30,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentMatchers.eq
import org.mockito.Mockito.verify
import org.mockito.kotlin.anyVararg
import org.mockito.kotlin.any
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.stub
@@ -77,7 +77,7 @@ class WifiHotspotSwitchPreferenceTest {
fun setValue_valueOn_startTethering() {
preference.storage(context).setBoolean(WifiHotspotSwitchPreference.KEY, true)
verify(mockTetheringManager).startTethering(eq(TETHERING_WIFI), anyVararg(), anyVararg())
verify(mockTetheringManager).startTethering(eq(TETHERING_WIFI), any(), any())
}
@Test