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.
-
Field Summary
Fields inherited from interface com.atlassian.plugin.module.ModuleFactory
LEGACY_MODULE_FACTORY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddModuleInstance
(String completeKey, Object instance) <T> T
createModule
(String name, com.atlassian.plugin.ModuleDescriptor<T> moduleDescriptor) static com.atlassian.plugin.module.PrefixDelegatingModuleFactory
-
Constructor Details
-
MockPrefixModuleFactory
public MockPrefixModuleFactory()
-
-
Method Details
-
newDelegatingFactory
public static com.atlassian.plugin.module.PrefixDelegatingModuleFactory newDelegatingFactory() -
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
-