java.lang.IllegalArgumentException: Invalid mock method testbox.TestBox$2#getName2() for private method of internal class

GitHub | numeralEasy | 8 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Jmockit 1.27: Faking private method not possible

    GitHub | 8 months ago | numeralEasy
    java.lang.IllegalArgumentException: Invalid mock method testbox.TestBox$2#getName2() for private method of internal class

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Invalid mock method testbox.TestBox$2#getName2() for private method of internal class

      at testbox.TestBox$2.<init>()
    2. testbox
      TestBox.testGetName_fails2
      1. testbox.TestBox$2.<init>(TestBox.java:42)
      2. testbox.TestBox.testGetName_fails2(TestBox.java:42)
      2 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:497)
      2 frames
    4. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      1 frame
    5. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      5 frames