RMock is a Java mock object framework typically used with JUnit 3.x. RMock has support for a setup-modify-run-verify workflow when writing JUnit tests. It integrates better with IDE refactoring support than some other popular mocking frameworks and allows designing classes and interfaces in a true test-first fashion.
The sections below illustrate using RMock for the mocking parts of Using Testing Frameworks with Groovy.
The Item Storer Example
We are going to consider how you might use RMock as part of testing the Item Storer Example.
Here is how we can test