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

GitHub | numeralEasy | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Jmockit 1.27: Faking private method not possible

    GitHub | 6 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