org.xwiki.test.mockito
Class MockitoComponentManager
java.lang.Object
org.xwiki.component.embed.EmbeddableComponentManager
org.xwiki.test.TestComponentManager
org.xwiki.test.mockito.MockitoComponentManager
- All Implemented Interfaces:
- org.xwiki.component.manager.ComponentManager, org.xwiki.component.phase.Disposable
public class MockitoComponentManager
- extends TestComponentManager
Helper class to make it extra simple to register Mock Components using Mockito.
- Since:
- 5.1RC1
- Version:
- $Id: e4e1980b0f30e4c5b86bb1deddfbfd230b02ac76 $
| Methods inherited from class org.xwiki.component.embed.EmbeddableComponentManager |
createLogger, dispose, getComponentDescriptor, getComponentDescriptorList, getComponentDescriptorList, getComponentEventManager, getComponentInstance, getInstance, getInstance, getInstanceList, getInstanceMap, getParent, hasComponent, hasComponent, initialize, registerComponent, registerComponent, release, setComponentEventManager, setParent, unregisterComponent, unregisterComponent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockitoComponentManager
public MockitoComponentManager()
registerMockComponent
public <T> T registerMockComponent(Type roleType,
String roleHint)
throws Exception
- Registers a Mock component.
- Type Parameters:
T - the mock- Parameters:
roleType - the type of the component role to registerroleHint - the role hint of the component to register
- Returns:
- the mock
- Throws:
Exception - in case of an error during registration
registerMockComponent
public <T> T registerMockComponent(Type roleType)
throws Exception
- Registers a Mock component (using the default role hint).
- Type Parameters:
T - the mock- Parameters:
roleType - the type of the component role to register
- Returns:
- the mock
- Throws:
Exception - in case of an error during registration
Copyright © 2004–2014 XWiki. All rights reserved.