I'm trying to verify that a method is called with a given argument. That argument is a non-nullable enum type. So I get the exception eq(SomeEnum.foo) must not be null. Here is a sample what I'm trying to do:
enum class SomeEnum {
foo, bar
}
open class MyClass {
fun doSomething() {
magic(SomeEnum.foo)
}
internal fun magic(whatever: SomeEnum) {}
}
@Test
fun mockitoBug() {
val sut = spy(MyClass())
sut.doSomething()
verify(sut).magic(eq(SomeEnum.foo))
}
Capturing does not work too. What can I do or is that really a bug as I assume?
I'm trying to verify that a method is called with a given argument. That argument is a non-nullable enum type. So I get the exception
eq(SomeEnum.foo) must not be null
. Here is a sample what I'm trying to do:Capturing does not work too. What can I do or is that really a bug as I assume?