You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following code val onSuccess = slot<(List<AEQuery>) -> Unit>() val onFailure = slot<(Failure) -> Unit>() val expectedResult: Either<Failure, List<AEQuery>> = expectedQueries.right() coEvery { getAEQueries(GetAEQueries.Params.forAEQueryRequest(queryRequest)).fold(capture(onFailure), capture(onSuccess)) } coAnswers { onSuccess.captured.invoke(expectedQueries) }
The coEvery function throws this error: Receiver class kotlin.jvm.functions.Function1$Subclass0 does not define or inherit an implementation of the resolved method 'abstract java.lang.Object invoke(java.lang.Object)' of interface kotlin.jvm.functions.Function1. java.lang.AbstractMethodError: Receiver class kotlin.jvm.functions.Function1$Subclass0 does not define or inherit an implementation of the resolved method 'abstract java.lang.Object invoke(java.lang.Object)' of interface kotlin.jvm.functions.Function1.
MockK version: 1.13.4
OS: macOS Monterrey 12.6.3
Kotlin version: 1.8.10
JDK version: 11.0.15
JUnit version: 4.13.1
Type of test: Unit test
I've seen some similar issues related to Proguard or R8 but it seems it's not the case for me
The text was updated successfully, but these errors were encountered:
Expected Behavior
Test passes with no errors
Current Behavior
Given the following code
val onSuccess = slot<(List<AEQuery>) -> Unit>() val onFailure = slot<(Failure) -> Unit>() val expectedResult: Either<Failure, List<AEQuery>> = expectedQueries.right() coEvery { getAEQueries(GetAEQueries.Params.forAEQueryRequest(queryRequest)).fold(capture(onFailure), capture(onSuccess)) } coAnswers { onSuccess.captured.invoke(expectedQueries) }
The coEvery function throws this error:
Receiver class kotlin.jvm.functions.Function1$Subclass0 does not define or inherit an implementation of the resolved method 'abstract java.lang.Object invoke(java.lang.Object)' of interface kotlin.jvm.functions.Function1. java.lang.AbstractMethodError: Receiver class kotlin.jvm.functions.Function1$Subclass0 does not define or inherit an implementation of the resolved method 'abstract java.lang.Object invoke(java.lang.Object)' of interface kotlin.jvm.functions.Function1.
I've seen some similar issues related to Proguard or R8 but it seems it's not the case for me
The text was updated successfully, but these errors were encountered: