jMock 2 is a library for testing Java code using mock objects.

See:
Description

jMock 2
org.jmock: The jMock "Domain-Specific Embedded Language" API.
org.jmock.api: The stable API that is used to extend jMock at it's published plug-in points.
org.jmock.integration.junit3: Integrates jMock with JUnit 3.
org.jmock.integration.junit4: Integrates jMock with JUnit 4.
org.jmock.lib: Implementations of the core interfaces that are used to adjust or extend jMock's basic functionality.
org.jmock.lib.action: Actions that fake the behaviour of mocked invocations.
org.jmock.lib.concurrent: Classes to help test concurrent code with jMock.
org.jmock.lib.legacy: Plugins that make it easier to use jMock with legacy code.
org.jmock.lib.script: Plugins that make it easier to write custom actions by scripting their behaviour with BeanShell.
org.jmock.syntax: Interfaces that define jMock's Domain Specific Embedded Language.

jMock 2 is a library for testing Java code using mock objects. Mock objects help you design and test the interactions between the objects in your programs.

jMock 2:

- makes it quick and easy to define mock objects, so you don't break the rhythm of programming.
- lets you define flexible constraints over object interactions, reducing the brittleness of your tests.
- acts as a "domain-specific embedded language" for specifying expectations so it is easy to read and understand the intent of tests with mock objects.
- uses real method calls to specify expectations, so code can be easily refactored in modern IDEs.
- is easy to extend.

More information can be found on the jMock website (www.jmock.org).