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 IFoo
class Foo:IFoo {
fun method(){
// ...
}
}
abstract class AbstractBar<T:IFoo>{
@Inject
lateinit var foo: T
}
class Bar: AbstractBar<Foo>() {
fun call(){
foo.method()
}
}
class Test {
@MockK
lateinit var foo: Foo
@InjectMockKs lateinit var bar: Bar
@Before
fun setUp() = MockKAnnotations.init(this)
@Test
fun test() {
every { foo.method() } answers { nothing }
bar.call()
verify { foo.method() }
}
}
and it produces an error: kotlin.UninitializedPropertyAccessException: lateinit property foo has not been initialized
mockk version: 1.7.12
What do I need to do to get it right? or is it a bug?
The text was updated successfully, but these errors were encountered:
I have this code:
and it produces an error:
kotlin.UninitializedPropertyAccessException: lateinit property foo has not been initialized
mockk version: 1.7.12
What do I need to do to get it right? or is it a bug?
The text was updated successfully, but these errors were encountered: