From 6d56967beff04b5fbc2fc17c3c5437c3097ef99b Mon Sep 17 00:00:00 2001 From: Valere Date: Wed, 16 Nov 2022 14:10:37 +0100 Subject: [PATCH] fix fake awaitTx --- .../java/org/matrix/android/sdk/test/fakes/FakeMonarchy.kt | 4 ++-- .../matrix/android/sdk/test/fakes/FakeRealmConfiguration.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix-sdk-android/src/test/java/org/matrix/android/sdk/test/fakes/FakeMonarchy.kt b/matrix-sdk-android/src/test/java/org/matrix/android/sdk/test/fakes/FakeMonarchy.kt index 87868e91d10..76ede759102 100644 --- a/matrix-sdk-android/src/test/java/org/matrix/android/sdk/test/fakes/FakeMonarchy.kt +++ b/matrix-sdk-android/src/test/java/org/matrix/android/sdk/test/fakes/FakeMonarchy.kt @@ -39,8 +39,8 @@ internal class FakeMonarchy { mockkStatic("org.matrix.android.sdk.internal.util.MonarchyKt") coEvery { instance.awaitTransaction(any<(Realm) -> Any>()) - } coAnswers { - secondArg Any>().invoke(fakeRealm.instance) + } answers { + secondArg<(Realm) -> Any>().invoke(fakeRealm.instance) } coEvery { instance.doWithRealm(any()) diff --git a/matrix-sdk-android/src/test/java/org/matrix/android/sdk/test/fakes/FakeRealmConfiguration.kt b/matrix-sdk-android/src/test/java/org/matrix/android/sdk/test/fakes/FakeRealmConfiguration.kt index 38b67b52612..f5545b7e768 100644 --- a/matrix-sdk-android/src/test/java/org/matrix/android/sdk/test/fakes/FakeRealmConfiguration.kt +++ b/matrix-sdk-android/src/test/java/org/matrix/android/sdk/test/fakes/FakeRealmConfiguration.kt @@ -34,8 +34,8 @@ internal class FakeRealmConfiguration { fun givenAwaitTransaction(realm: Realm) { val transaction = slot<(Realm) -> T>() - coEvery { awaitTransaction(instance, capture(transaction)) } coAnswers { - secondArg T>().invoke(realm) + coEvery { awaitTransaction(instance, capture(transaction)) } answers { + secondArg<(Realm) -> T>().invoke(realm) } } }