Class MockPrefixModuleFactory
- java.lang.Object
-
- com.atlassian.bamboo.mock.plugins.MockPrefixModuleFactory
-
- All Implemented Interfaces:
com.atlassian.plugin.module.ModuleFactory
,com.atlassian.plugin.module.PrefixModuleFactory
public class MockPrefixModuleFactory extends Object implements com.atlassian.plugin.module.PrefixModuleFactory
Use it to instantiate fake module descriptors in unit tests if you don't want them to throw exceptions left right and centre.
You may add instances of modules for given module complete key (plugin + module). Otherwise module classes are expected to have no-arg constructor and require no dependencies.
-
-
Constructor Summary
Constructors Constructor Description MockPrefixModuleFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MockPrefixModuleFactory
addModuleInstance(String completeKey, Object instance)
<T> T
createModule(String name, com.atlassian.plugin.ModuleDescriptor<T> moduleDescriptor)
String
getPrefix()
static com.atlassian.plugin.module.PrefixDelegatingModuleFactory
newDelegatingFactory()
-
-
-
Method Detail
-
newDelegatingFactory
public static com.atlassian.plugin.module.PrefixDelegatingModuleFactory newDelegatingFactory()
-
getPrefix
public String getPrefix()
- Specified by:
getPrefix
in interfacecom.atlassian.plugin.module.PrefixModuleFactory
-
createModule
public <T> T createModule(String name, com.atlassian.plugin.ModuleDescriptor<T> moduleDescriptor) throws com.atlassian.plugin.PluginParseException
- Specified by:
createModule
in interfacecom.atlassian.plugin.module.ModuleFactory
- Throws:
com.atlassian.plugin.PluginParseException
-
addModuleInstance
public MockPrefixModuleFactory addModuleInstance(String completeKey, Object instance)
-
-