JMockit Quick Tutorial and Revelation

JMockit is a powerful mocking framework in Java that provides extended functionality that goes beyond the capabilities of all other solutions on the market so far. While most mocking frameworks are proxy based and depend on Reflection to hide the dependent behavior, JMockit falls further and deeper with solving some critical problems such as mocking final classes and static methods by using the Instrumentation API presented in Java 5. The Instrumentation API allows a direct bytecode replacement in the virtual machine via java agents that modify the codebase of the current classes with the one from our mocked representation (either… Continue Reading