Mockito is an open source testing framework for Java released under the MIT License.
[3][4] The framework allows the creation of test double objects (mock objects) in automated unit tests for the purpose of test-driven development (TDD) or behavior-driven development (BDD).
Mockito allows developers to verify the behavior of the system under test (SUT) without establishing expectations beforehand.
[6] Mockito attempts to eliminate the expect-run-verify pattern[7] by removing the specification of expectations.
The result of HelloApplication launching will be the following: Unit test for HelloActable component may look like this: It uses mock objects for the Greeter and Appendable interfaces, and implicitly assumes the next use case: Integration test code for testing HelloActable wired together with Greeter may look like the following: It uses mock objects only in place of Appendable interfaces, uses the real implementations for other (HelloActable and Greeter) interfaces, and implicitly assumes the next use case: As can be seen from the import statements of HelloActionUnitTest and HelloActionIntegrationTest classes, it is necessary to put some Mockito jars and JUnit jars in your class path to be able to compile and run the test classes.