Matchers.any() for null value in Mockito

后端 未结 4 1990
夕颜
夕颜 2020-12-25 09:46

Suppose I am having this object objectDemo which calls to the method objectDemoMethod with 2 parameters String and null.

4条回答
  •  無奈伤痛
    2020-12-25 10:17

    Just use:

    Mockito.verify(objectDemo, Mockito.times(1)).objectDemoMethod(Matchers.any(String.class), (ClassName) isNull());

    Above help me in java 8 version. Hope this will help you.

提交回复
热议问题