0
private int privateMethod(Object o, boolean b) throws Exception

--

PowerMockito.doThrow(new Throwable("Just a throwable")).when(spy, "privateMethod", Mockito.any(), Mockito.any());

--

org.mockito.exceptions.misusing.UnfinishedStubbingException: 
Unfinished stubbing detected 

我已经尝试将 any() 切换到 anyObject() 等。但我遇到了存根问题......

错误在哪里?

4

1 回答 1

0

匹配器org.mockito.Matchers.anyBoolean为我工作。

anyObject并且any与原语不匹配。

于 2015-03-04T10:50:49.477 回答