我得到了错误消息:
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:无效使用参数匹配器!0匹配器预期,1记录:-> at *.SegmentExportingTest.happyDay(SegmentExportingTest.java:37)如果匹配器与原始值组合在一起://不正确: someMethod(anyObject(),“原始字符串”);当使用匹配
但是,当您运行测试时,它们会随着输出而下降:
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:参数匹配器的无效使用!0匹配器预期,1记录:-> at com.hodzi.stackviewer.questions.detail.QuestionDetailPresenterTest.voteTest(QuestionDetailPresenterTest.kt(QuestionsInteractor::class.
我试着用mockito来模拟它,这样它就会返回null。这是我拥有的代码:我得到了一个标准的InvalidUseOfMatchersExceptionorg.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Invalid use of argument matchers!我正确地使用了匹配器-- anyL
在这次升级之后,Mockito开始在所有接口测试中抛出InvalidUseOfMatchersException,在这些测试中,Mockito.mock()方法在“接口”或“抽象类”上被调用。Here are few examples of calls that are failing:
i) DataSource dataSource = Mockito.mock(DataSource.class