summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Liu <congxiliu@google.com> 2023-04-18 17:05:41 +0000
committer Kevin Liu <congxiliu@google.com> 2023-04-18 17:34:19 +0000
commit8eb89b983340404ccd121abbcc0a73edbc886ecc (patch)
tree7e387915a92ebc92a6d605862a265bc680b87ff7
parent952b462cf99198f4b90087cc0774a887dc0bcc28 (diff)
Replace Sealed Class mock for Robolectric test
Replaced mock for Sealed class Icon to Fake, since inlined Mockito does not support mocking Sealed classes Test: atest SystemUiRoboTests atest SystemUITests Bug: 278617812 Change-Id: I4c125998da07a6073396cf272384d3b5e63b2030
-rw-r--r--packages/SystemUI/Android.bp4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractorTest.kt14
2 files changed, 7 insertions, 11 deletions
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index 9d32e905d85d..62c6c1df91b2 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -243,15 +243,11 @@ filegroup {
// domain
"tests/src/com/android/systemui/keyguard/domain/interactor/AlternateBouncerInteractorTest.kt",
"tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt",
- "tests/src/com/android/systemui/keyguard/domain/interactor/AlternateBouncerInteractorTest.kt",
- "tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt",
"tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractorTest.kt",
"tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionInteractorTest.kt",
"tests/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractorTest.kt",
"tests/src/com/android/systemui/keyguard/domain/quickaffordance/FakeKeyguardQuickAffordanceRegistry.kt",
"tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorWithCoroutinesTest.kt",
- "tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt",
- "tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorWithCoroutinesTest.kt",
// ui
"tests/src/com/android/systemui/keyguard/ui/viewmodel/DreamingToLockscreenTransitionViewModelTest.kt",
"tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModelTest.kt",
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractorTest.kt
index 96fff6499be5..23f05233b5e5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractorTest.kt
@@ -635,14 +635,14 @@ class KeyguardQuickAffordanceInteractorTest : SysuiTestCase() {
}
companion object {
- private val ICON: Icon = mock {
- whenever(this.contentDescription)
- .thenReturn(
+ private const val CONTENT_DESCRIPTION_RESOURCE_ID = 1337
+ private val ICON: Icon =
+ Icon.Resource(
+ res = CONTENT_DESCRIPTION_RESOURCE_ID,
+ contentDescription =
ContentDescription.Resource(
res = CONTENT_DESCRIPTION_RESOURCE_ID,
- )
- )
- }
- private const val CONTENT_DESCRIPTION_RESOURCE_ID = 1337
+ ),
+ )
}
}