when(mockedService.patch("1", Matchers.
与:
when(mockedService.patch("1", anyMap())).thenReturn(object);
但它返回:
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Invalid use of argument matchers!
2 matchers expected, 1 recorded.
它只在我放任何(String.class)时才有效:
when(mockedService.patch(any(String.class), Matchers.
但是我想要选择放置实际值而不是任何String
本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/java-mockito-matchersrenheditu.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:11 月 11, 2019 at 07:18 下午