1 Reply Latest reply on Oct 2, 2011 6:39 AM by 796440

    How Static methods are mocked in any Mocking Framework like JMockit?

      I learnt that we can mock static methods using core java library with PowerMock?Jmockit.Want to understand how it is doing it internally in brief?

      My Understanding:- As we define the mock class in the test case itself(Though there are different ways to create mock class in every framework like using expectation syntax in Jmockit), these framework must be defining custom classloader thru which they must be looking for that class definition inside the testcase itself.Its a Guess. Not sure if it is correct? But even if i am right, preference of classloader hirerchy is boootstraploader then applicationclassloader than customerclassloader. So how does it pick from customerclassloader instead of applicationclassloader ?is there a way we can set the preference of customer class loader above to applicationclassloader ?