use of com.hotels.styx.startup.extensions.ConfiguredPluginFactory in project styx by ExpediaGroup.
the class StyxServerComponentsTest method loadsPlugins.
@Test
public void loadsPlugins() {
ConfiguredPluginFactory f1 = new ConfiguredPluginFactory("plugin1", any -> stubPlugin("MyResponse1"));
ConfiguredPluginFactory f2 = new ConfiguredPluginFactory("plugin2", any -> stubPlugin("MyResponse2"));
StyxServerComponents components = new StyxServerComponents.Builder().registry(new MicrometerRegistry(new CompositeMeterRegistry())).styxConfig(new StyxConfig()).pluginFactories(List.of(f1, f2)).build();
List<NamedPlugin> plugins = components.plugins();
List<String> names = plugins.stream().map(NamedPlugin::name).collect(toList());
assertThat(names, contains("plugin1", "plugin2"));
}
Aggregations