public class

EasyMockAnnotations

extends Object
java.lang.Object
   ↳ com.atlassian.jira.easymock.EasyMockAnnotations

Class Overview

Utilities for creating mocks.

Summary

Public Methods
static void initMocks(Object object)
Creates a new mock for every field of the object that is marked with Mock, using EasyMock's create* methods.
static void initMocks(Object object, MockFactory mockFactory)
Creates a new mock for every field of the object that is marked with Mock, using the provided mock factory.
static void replayMocks(Object object, MockAction mockAction)
Replays every mock object that is a field of this class by calling MockAction#doWithMock(Mock, Class, Object) on the provided mock action.
static void replayMocks(Object object)
Replays every mock object that is a field of this class by calling EasyMock.replay()
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static void initMocks (Object object)

Creates a new mock for every field of the object that is marked with Mock, using EasyMock's create* methods.

Parameters
object an object

public static void initMocks (Object object, MockFactory mockFactory)

Creates a new mock for every field of the object that is marked with Mock, using the provided mock factory.

Parameters
object an object
mockFactory the MockFactory that will actually create the mocks

public static void replayMocks (Object object, MockAction mockAction)

Replays every mock object that is a field of this class by calling MockAction#doWithMock(Mock, Class, Object) on the provided mock action.

Parameters
object an object
mockAction the MockAction to use for replaying mocks

public static void replayMocks (Object object)

Replays every mock object that is a field of this class by calling EasyMock.replay()

Parameters
object an object