com.atlassian.jira.mock.component
Class MockComponentWorker

java.lang.Object
  extended by com.atlassian.jira.mock.component.MockComponentWorker
All Implemented Interfaces:
ComponentAccessor.Worker

public class MockComponentWorker
extends Object
implements ComponentAccessor.Worker

This component worker can be used with the component accessor, return mock instances of components for unit testing.

Since:
v4.4

Constructor Summary
MockComponentWorker()
           
 
Method Summary
<T,U extends T>
MockComponentWorker
addMock(Class<T> componentInterface, U componentMock)
           
<T> T
getComponent(Class<T> componentClass)
           
<T> T
getComponentOfType(Class<T> componentClass)
           
 FieldAccessor getFieldAccessor()
           
<T> T
getOSGiComponentInstanceOfType(Class<T> componentClass)
           
<T,U extends T>
void
registerMock(Class<T> componentInterface, U componentMock)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockComponentWorker

public MockComponentWorker()
Method Detail

registerMock

public <T,U extends T> void registerMock(Class<T> componentInterface,
                                         U componentMock)

addMock

public <T,U extends T> MockComponentWorker addMock(Class<T> componentInterface,
                                                   U componentMock)

getComponent

public <T> T getComponent(Class<T> componentClass)
Specified by:
getComponent in interface ComponentAccessor.Worker

getComponentOfType

public <T> T getComponentOfType(Class<T> componentClass)
Specified by:
getComponentOfType in interface ComponentAccessor.Worker

getOSGiComponentInstanceOfType

public <T> T getOSGiComponentInstanceOfType(Class<T> componentClass)
Specified by:
getOSGiComponentInstanceOfType in interface ComponentAccessor.Worker

getFieldAccessor

public FieldAccessor getFieldAccessor()
Specified by:
getFieldAccessor in interface ComponentAccessor.Worker


Copyright © 2002-2012 Atlassian. All Rights Reserved.