Using Mock Objects
This extract from the book “Pragmatic Unit Testing in Java with JUnit” written by Andy Hunt and Dave Thomas provides an introduction to the usage of mock objects during Java unit tests. They define the usage of mocks in unit testing as the unit similar to the use of lighting doubles in the movies: A mock object is simply a debug replacement for a real-world object.