This exception may occur if matchers are combined with raw values

 

org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Invalid use of argument matchers!
3 matchers expected, 2 recorded:
-> at com.FilterDeviceReplaceTest.init(FilterDeviceReplaceTest.java:41)
-> at com.FilterDeviceReplaceTest.init(FilterDeviceReplaceTest.java:46)

This exception may occur if matchers are combined with raw values:
    //incorrect:
    someMethod(anyObject(), "raw String");
When using matchers, all arguments have to be provided by matchers.
For example:
    //correct:
    someMethod(anyObject(), eq("String by matcher"));

For more info see javadoc for Matchers class.

 

posted @ 2014-12-16 12:36  沧海一滴  阅读(3464)  评论(0编辑  收藏  举报