An initializationError
is thrown. I'm using powermock 1.6.4 and javassist-3.20.0. It seems I can't mock and mockstatic on the same class (at the same time).
interface B
{
public static B getA()
{
return new B()
{
};
}
}
a test code is:
@PrepareForTest({B.class})
@Test
public void testB()
{
B a = mock( B.class );
mockStatic( B.class );
when( B.getA() ).thenReturn( a );
}