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 

I already tried switching the any() to anyObject() etc. But i am getting the stubbing problem...

Where is the error?

Gobliins
  • 3,848
  • 16
  • 67
  • 122

1 Answers1

0

The org.mockito.Matchers.anyBoolean matcher worked for me.

anyObject and any didn't match against primitives.

David Lavender
  • 8,021
  • 3
  • 35
  • 55
  • tried it with anyObject() and anyBoolean(), also tried the real object and false, but always the same error – Gobliins Mar 04 '15 at 11:01