@Test public void providesMeaningfulErrorMessageWhenConfiguredFactoryClassCannotBeLoaded() { String jarFile = "/plugins/oneplugin/testPluginA-1.0-SNAPSHOT.jar"; Path pluginsPath = fixturesHome(FileSystemPluginFactoryLoader.class, jarFile); SpiExtensionFactory factory = new SpiExtensionFactory("incorrect.plugin.class.name.TestPluginModule", pluginsPath.toString()); SpiExtension spiExtension = new SpiExtension(factory, config, null); Exception e = assertThrows(ConfigurationException.class, () -> new FileSystemPluginFactoryLoader().load(spiExtension)); assertThat(e.getMessage(), matchesPattern("Could not load a plugin factory for configuration=SpiExtension\\{" + "factory=SpiExtensionFactory\\{" + "class=incorrect.plugin.class.name.TestPluginModule, " + "classPath=.*[\\\\/]components[\\\\/]proxy[\\\\/]target[\\\\/]test-classes[\\\\/]plugins[\\\\/]oneplugin[\\\\/]testPluginA-1.0-SNAPSHOT.jar" + "\\}\\}")); }
@Override public PluginFactory load(SpiExtension spiExtension) { return newPluginFactory(spiExtension); }
FileSystemPluginFactoryLoader implements PluginFactoryLoader { @Override public PluginFactory load(SpiExtension spiExtension) { return newPluginFactory(spiExtension); } }
FileSystemPluginFactoryLoader implements PluginFactoryLoader { @Override public PluginFactory load(SpiExtension spiExtension) { return newPluginFactory(spiExtension); }  }
FileSystemPluginFactoryLoader implements PluginFactoryLoader { @Override public PluginFactory load(SpiExtension spiExtension) { return newPluginFactory(spiExtension); }  @Override PluginFactory load(SpiExtension spiExtension); }
FileSystemPluginFactoryLoader implements PluginFactoryLoader { @Override public PluginFactory load(SpiExtension spiExtension) { return newPluginFactory(spiExtension); }  @Override PluginFactory load(SpiExtension spiExtension);  }