@Test public void suppliesConfiguredPlugin() { String yaml = "" + "plugins:\n" + " active: myPlugin\n" + " all:\n" + " myPlugin:\n" + " factory:\n" + " class: com.hotels.styx.startup.extensions.PluginLoadingForStartupTest$MyPluginFactory\n" + " classPath: " + FIXTURES_CLASS_PATH + "\n" + " config:\n" + " testConfiguration: test-foo-bar\n"; List<NamedPlugin> plugins = PluginLoadingForStartup.loadPlugins(environment(yaml)); NamedPlugin plugin = plugins.get(0); assertThat(plugin.originalPlugin(), is(instanceOf(MyPlugin.class))); assertThat(plugin.name(), is("myPlugin")); assertThat(((MyPlugin) plugin.originalPlugin()).myPluginConfig, is(new MyPluginConfig("test-foo-bar"))); }
public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private  PluginLoadingForStartup(); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private  PluginLoadingForStartup(); static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories); static List<NamedPlugin> loadPlugins(Environment environment); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private  PluginLoadingForStartup(); static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories); static List<NamedPlugin> loadPlugins(Environment environment);  }