com.atlassian.jira.easymock
Class EasyMockAnnotations

java.lang.Object
  extended by com.atlassian.jira.easymock.EasyMockAnnotations

public class EasyMockAnnotations
extends Object

Utilities for creating mocks.

Since:
4.4

Method Summary
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)
          Replays every mock object that is a field of this class by calling EasyMock.replay()
static void replayMocks(Object object, com.atlassian.jira.easymock.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initMocks

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

initMocks

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

replayMocks

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

replayMocks

public static void replayMocks(Object object,
                               com.atlassian.jira.easymock.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


Copyright © 2002-2013 Atlassian. All Rights Reserved.