PowerMock がスローしorg.powermock.reflect.exceptions.MethodNotFoundException: No methods matching the name(s) methodInsideFoo were found in the class hierarchy of class com.something.Something.
ます。
テストコード:
Something spied = spy(new Something());
doNothing().when( spied, "methodInsideFoo", "ABC", Some.class );
spied.foo( "ABC", Some.class );
verifyPrivate( spied ).invoke( "methodInsideFoo", "ABC", Some.class );
そして、これは私がモックしようとしている方法です:
protected void methodInsideFoo ( String a, Class b )
{
System.out.println("Should not see me");
}
しかし、クラス (2 番目のパラメーター) を削除すると、機能します。何か不足していますか?