Home > Blockchain >  What is the matcher of any object of particular class in mockitokotlin2?
What is the matcher of any object of particular class in mockitokotlin2?

Time:03-26

there is any() in mockitokotlin2 but it's any object. I need a matcher for any object of MyClass, like org.mockito.Matchers.any(MyClass::class.java)

is it possible?

CodePudding user response:

In mockito-kotlin you can specify your type as a type argument of any:

org.mockito.kotlin.any<MyClass>()
  • Related