org.xwiki.test.mockito
Class MockitoComponentManagerRule
java.lang.Object
org.xwiki.component.embed.EmbeddableComponentManager
org.xwiki.test.ComponentManagerRule
org.xwiki.test.mockito.MockitoComponentManagerRule
- All Implemented Interfaces:
- org.junit.rules.MethodRule, org.xwiki.component.manager.ComponentManager
public class MockitoComponentManagerRule
- extends ComponentManagerRule
Helper class to make it extra simple to register Mock Components using Mockito.
- Since:
- 4.3.1
- Version:
- $Id: 2aa978d009c355274519c794f4a49b9abe999f7c $
| Methods inherited from class org.xwiki.component.embed.EmbeddableComponentManager |
createLogger, 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 |
MockitoComponentManagerRule
public MockitoComponentManagerRule()
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-2013 XWiki. All Rights Reserved.