Class 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 Detail

      • MockPrefixModuleFactory

        public MockPrefixModuleFactory()
    • Method Detail

      • newDelegatingFactory

        public static com.atlassian.plugin.module.PrefixDelegatingModuleFactory newDelegatingFactory()
      • getPrefix

        public String getPrefix()
        Specified by:
        getPrefix in interface com.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 interface com.atlassian.plugin.module.ModuleFactory
        Throws:
        com.atlassian.plugin.PluginParseException