File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
src/test/java/com/google/firebase/ai/type Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,6 @@ dependencies {
123123 testImplementation(libs.robolectric)
124124 testImplementation(libs.truth)
125125 testImplementation(libs.mockito.core)
126- testImplementation(libs.mockito.kotlin)
127126 testImplementation(libs.ktor.client.mock)
128127
129128 androidTestImplementation(libs.androidx.espresso.core)
Original file line number Diff line number Diff line change @@ -5,21 +5,19 @@ import android.content.pm.PackageManager
55import com.google.firebase.FirebaseApp
66import com.google.firebase.ai.util.doBlocking
77import io.kotest.assertions.throwables.shouldThrow
8- import io.ktor.client.plugins.websocket.testing.*
8+ import io.ktor.client.plugins.websocket.testing.EmptyWebSockets
99import kotlinx.coroutines.Dispatchers
1010import org.junit.Test
11- import org.mockito.kotlin.*
11+ import org.mockito.Mockito
1212
1313class LiveSessionTest {
1414
1515 @Test
1616 fun `startAudioConversation without permission throws exception` () = doBlocking {
17- val mockContext = mock<Context > {
18- on { checkSelfPermission(android.Manifest .permission.RECORD_AUDIO ) } doReturn PackageManager .PERMISSION_DENIED
19- }
20- val mockFirebaseApp = mock<FirebaseApp > {
21- on { applicationContext } doReturn mockContext
22- }
17+ val mockContext = Mockito .mock(Context ::class .java)
18+ Mockito .`when `(mockContext.checkSelfPermission(android.Manifest .permission.RECORD_AUDIO )).thenReturn(PackageManager .PERMISSION_DENIED )
19+ val mockFirebaseApp = Mockito .mock(FirebaseApp ::class .java)
20+ Mockito .`when `(mockFirebaseApp.applicationContext).thenReturn(mockContext)
2321 val session = LiveSession (
2422 session = EmptyWebSockets .client.session,
2523 blockingDispatcher = Dispatchers .IO ,
You can’t perform that action at this time.
0 commit comments