@Test public void providesNamesForAllActivatedPlugins() { String yaml = "" + "plugins:\n" + " active: myPlugin0,myPlugin2\n" + " all:\n" + " myPlugin0:\n" + " factory:\n" + " class: com.hotels.styx.startup.extensions.PluginLoadingForStartupTest$MyPluginFactory\n" + " classPath: " + FIXTURES_CLASS_PATH + "\n" + " config:\n" + " testConfiguration: instance1\n" + " myPlugin1:\n" + " factory:\n" + " class: com.hotels.styx.startup.extensions.PluginLoadingForStartupTest$MyPluginFactory\n" + " classPath: " + FIXTURES_CLASS_PATH + "\n" + " config:\n" + " testConfiguration: instance2\n" + " myPlugin2:\n" + " factory:\n" + " class: com.hotels.styx.startup.extensions.PluginLoadingForStartupTest$MyPluginFactory\n" + " classPath: " + FIXTURES_CLASS_PATH + "\n" + " config:\n" + " testConfiguration: instance3\n"; List<NamedPlugin> plugins = PluginLoadingForStartup.loadPlugins(environment(yaml)); List<String> pluginNames = plugins.stream() .map(NamedPlugin::name) .collect(toList()); assertThat(pluginNames, contains("myPlugin0", "myPlugin2")); }
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);  }