Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Groovy Mocks

Mock objects are used to assist (typically unit) testing of classes in isolation.

The Groovy Mock resides in the groovy.mock.interceptor package. It is an all-groovy mock testing library.

In principle, it is used like this:

Groovy Mocks were inspired by EasyMock.

Find background information about Mocks and endo-testing under XP2000 conference paper.

For an extended example, see Using Testing Frameworks with Groovy

Features

  • typical mock style of failing early
  • mocks instance and class methods
  • mocks final methods and final Collaborators
  • mocks Groovy and Java Collaborators (but C0
  • No labels