76 lines
3.1 KiB
Diff
76 lines
3.1 KiB
Diff
From eeeb323b495245354be3b98089a430ee04f67ae5 Mon Sep 17 00:00:00 2001
|
|
From: Peter Cai <peter@typeblog.net>
|
|
Date: Sat, 9 Dec 2023 18:37:08 -0500
|
|
Subject: [PATCH 08/10] Revert "Convert BubbleDataRepositoryTest to use
|
|
mockito-kotlin"
|
|
|
|
This reverts commit 625a23ff22f0a9327b9a24341dfa0b8fbaf61a1b.
|
|
---
|
|
.../Shell/tests/unittest/Android.bp | 1 -
|
|
.../shell/bubbles/BubbleDataRepositoryTest.kt | 17 ++++++++++-------
|
|
2 files changed, 10 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/libs/WindowManager/Shell/tests/unittest/Android.bp b/libs/WindowManager/Shell/tests/unittest/Android.bp
|
|
index aadadd604d3e..70106c3d41b4 100644
|
|
--- a/libs/WindowManager/Shell/tests/unittest/Android.bp
|
|
+++ b/libs/WindowManager/Shell/tests/unittest/Android.bp
|
|
@@ -44,7 +44,6 @@ android_test {
|
|
"frameworks-base-testutils",
|
|
"kotlinx-coroutines-android",
|
|
"kotlinx-coroutines-core",
|
|
- "mockito-kotlin2",
|
|
"mockito-target-extended-minus-junit4",
|
|
"truth",
|
|
"testables",
|
|
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataRepositoryTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataRepositoryTest.kt
|
|
index e35995775f76..0e05e01a8da3 100644
|
|
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataRepositoryTest.kt
|
|
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataRepositoryTest.kt
|
|
@@ -29,11 +29,11 @@ import com.google.common.truth.Truth.assertThat
|
|
import org.junit.After
|
|
import org.junit.Before
|
|
import org.junit.Test
|
|
-import org.mockito.kotlin.any
|
|
-import org.mockito.kotlin.mock
|
|
-import org.mockito.kotlin.never
|
|
-import org.mockito.kotlin.spy
|
|
-import org.mockito.kotlin.verify
|
|
+import org.mockito.Mockito
|
|
+import org.mockito.Mockito.mock
|
|
+import org.mockito.Mockito.never
|
|
+import org.mockito.Mockito.spy
|
|
+import org.mockito.Mockito.verify
|
|
|
|
class BubbleDataRepositoryTest : ShellTestCase() {
|
|
|
|
@@ -124,7 +124,7 @@ class BubbleDataRepositoryTest : ShellTestCase() {
|
|
|
|
private val testHandler = Handler(Looper.getMainLooper())
|
|
private val mainExecutor = HandlerExecutor(testHandler)
|
|
- private val launcherApps = mock<LauncherApps>()
|
|
+ private val launcherApps = mock(LauncherApps::class.java)
|
|
|
|
private val persistedBubbles = SparseArray<List<BubbleEntity>>()
|
|
|
|
@@ -158,7 +158,8 @@ class BubbleDataRepositoryTest : ShellTestCase() {
|
|
assertThat(persistedBubbles).isEqualTo(validEntitiesByUser)
|
|
|
|
// No invalid users, so no persist to disk happened
|
|
- verify(dataRepository, never()).persistToDisk(any())
|
|
+ verify(dataRepository, never()).persistToDisk(
|
|
+ any(SparseArray<List<BubbleEntity>>()::class.java))
|
|
}
|
|
|
|
@Test
|
|
@@ -198,4 +199,6 @@ class BubbleDataRepositoryTest : ShellTestCase() {
|
|
// Verify that persist to disk happened with the new valid entities list.
|
|
verify(dataRepository).persistToDisk(validEntitiesByUser)
|
|
}
|
|
+
|
|
+ fun <T> any(type: Class<T>): T = Mockito.any<T>(type)
|
|
}
|
|
\ No newline at end of file
|
|
--
|
|
2.43.1
|
|
|