Misplaced argument matcher detected here. You cannot use argument matchers outside of verification or stubbing in Mockito

前端 未结 3 1869
感动是毒
感动是毒 2021-01-01 09:27

Out of the following two test cases in BundleProcessorTest.java, i am getting below exception, although, my first test case passes successfully.

3条回答
  •  没有蜡笔的小新
    2021-01-01 10:12

    You are using mockito anyString() while calling the test method, it should be used only for verifying a mock object to ensure a certain method is called with any string parameter inside the test, but not to invoke the test itself. For your test use empty string "" instead to anyString().

提交回复
热议问题