Package mockit.integration.junit4
package mockit.integration.junit4
Provides integration with JUnit 4.x test runners, for version 4.5 or newer. This integration provides the
following benefits to test code:
- Instance fields annotated with
@Tested,@Injectable,@Mocked, or@Capturingare properly initialized. - Test methods accept mock parameters (annotated with
@Injectable,@Mocked, or@Capturing), whose values are mocked instances automatically created by JMockit and passed by the test runner when the test method is executed. - Expected invocations specified through the Mocking API are automatically verified before the execution of a test is completed.
- Fake classes applied with the Faking API from inside a method annotated as a
@Testor a@Beforemethod are discarded right after the execution of the test method or the whole test, respectively. Similarly, fakes applied from a@BeforeClassmethod are discarded after all tests in a test class have executed.
-
ClassesClassDescriptionStartup fake that modifies the JUnit 4.5+ test runner so that it calls back to JMockit immediately after every test executes.Startup fake which works in conjunction with
JUnit4TestRunnerDecoratorto provide JUnit 4.5+ integration.