You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If you create a Mock up of a class which extends Throwable, and Mock out printStackTrace(), as shown in the example code below, a call to the printStackTrace() on an instance of the mocked class will result in the following error: java.lang.NoClassDefFoundError: package/Class$MyThrowable
This error does not does not occur if:
Throwable is used in the MockUp instead of MyThrowable
The printStackTrace() method isn't mocked, but the MockUp is still created
There is an an override of printStackTrace in MyThrowable
Code to Reproduce
@Test
public void test()
{
new MockUp<MyThrowable>() {
@Mock
void printStackTrace() {}
};
new MyThrowable().printStackTrace();
}
static class MyThrowable extends Throwable {}
The text was updated successfully, but these errors were encountered:
Version
JMockit: 1.33
Java: 8
Description
If you create a Mock up of a class which extends Throwable, and Mock out printStackTrace(), as shown in the example code below, a call to the printStackTrace() on an instance of the mocked class will result in the following error:
java.lang.NoClassDefFoundError: package/Class$MyThrowable
This error does not does not occur if:
Code to Reproduce
The text was updated successfully, but these errors were encountered: