Audience
DevOps teams looking for an Unit Testing solution
About JMockit
The toolkit is provided as a set of artifacts deployed to the Maven Central repository. It requires Java 7 or newer for test execution; tests must use JUnit or TestNG. For instructions on how to add the library to a Java project, see Running tests with JMockit. In this tutorial we examine the APIs available in the library, with the help of example tests (using Java 8). The central API - a single annotation - provides support for the automatic instantiation and initialization of the objects to be tested. Then we have the mocking API (also known as the "Expectations" API), intended for tests which use mocked dependencies. Finally, there is a small faking API (aka the "Mockups" API), which can be used for the creation and application of fake implementations that avoid the full cost of external components.