Closed Horcrux7 closed 4 years ago
Ok, for interfaces I need a anonymous Mockup class. This is tricky. Then it work.
public static <T extends TestInterface> void main( String[] args ) {
new MockUp<T>() {
@Mock
Object $advice( Invocation invocation ) {
System.out.println( "MockInterface advice called, on " + invocation.getInvokedMember().getName() );
return null;
}
};
I run the follow test program:
It produce the follow output:
It look like that the static method can't mock with $advice and interface methods also not. In the documentation I can't find any related. Is this a limit of JMockit or a bug?