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
interface Foo {
fun foo(name: String): Result
}
class Test111 { @test fun test() {
val myMock = mock() {
on { foo(any()) } doAnswer { Result.success(true) }
}
Mocking a method that returns a Result does not work.Instead of Result it returns Result<Result>. There is a simple example to reproduce it:
import org.amshove.kluent.shouldBeEqualTo
import org.junit.jupiter.api.Test
import org.mockito.kotlin.*
import org.mockito.kotlin.any
// User: victor Date: 7/17/23 Time: 1:35 PM
interface Foo {
fun foo(name: String): Result
}
class Test111 {
@test fun test() {
val myMock = mock() {
on { foo(any()) } doAnswer { Result.success(true) }
}
}
I got the following error:
Expected: <Success(true)> but was: <Success(Success(true))>
The text was updated successfully, but these errors were encountered: