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
Please answer the following questions for yourself before submitting an issue.
I am running the latest version
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed
Expected Behavior
Mockk should return Result
Current Behavior
Based on the tutorial, I though I can use return Result type using Mockk
however it is not possible, mockk returns Result<Result<T>> rather than Result<T>
Steps to Reproduce
excute the following unit test
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
MockK version: 1.9.3
OS: mac 10.14.6
Kotlin version: 1.3.41
JDK version: 11.0.4.hs-adpt
JUnit version: 5.3.4.2
Type of test: unit test
Failure Logs
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at kotlin.reflect.jvm.internal.calls.CallerImpl$Constructor.call(CallerImpl.kt:41)
at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:106)
at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:152)
at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:110)
at kotlin.reflect.full.KClasses.createInstance(KClasses.kt:283)
at io.kotlintest.runner.jvm.JvmKt.instantiateSpec(jvm.kt:15)
at io.kotlintest.runner.jvm.TestEngine.createSpec(TestEngine.kt:122)
at io.kotlintest.runner.jvm.TestEngine.access$createSpec(TestEngine.kt:19)
at io.kotlintest.runner.jvm.TestEngine$submitSpec$1.run(TestEngine.kt:105)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassCastException: class kotlin.Result cannot be cast to class java.lang.String (kotlin.Result is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
at MockkTest.<init>(MockkTest.kt:16)
... 18 more
Minimal reproducible code (the gist of this issue)
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
Mockk should return Result
Current Behavior
Based on the tutorial, I though I can use return Result type using Mockk
however it is not possible, mockk returns
Result<Result<T>>
rather thanResult<T>
Steps to Reproduce
excute the following unit test
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs
Minimal reproducible code (the gist of this issue)
The text was updated successfully, but these errors were encountered: