I am trying to mock java.awt.Toolkit.beep() using JMockit Expectations. I have the following code in my test case:
new Expectations() {
Toolkit mock;
{
mock.beep();
}
}.endRecording();
When I run the test case (JUnit 4), I get the following exception at the "new Expectations" line:
java.lang.ClassFormatError: Code attribute in native or abstract methods in class file $Mock
Any ideas?