Overview
JMockit is an open source toolkit which supports the generation of mock objects using bytecode instrumentation. This is achieved by “hotswapping” the current class loaded in the JVM with a one which implements the required mock behaviour.
Here I shall not define the features or make comparison with other mock frameworks. I shall concentrate on examples which depict the features in practice.