CoreConfigurationProvider implements ConfigurationProviderSpi { @Override public void setConfiguration(Configuration config, ClassLoader classLoader) { Objects.requireNonNull(config.getContext()); Configuration old = this.configurations.put(classLoader, Objects.requireNonNull(config)); if(old != null){ LOG.warning(String.format("Replaced config %s with %s for classloader %s", old, config, classLoader)); } } CoreConfigurationProvider(); @Override Configuration getConfiguration(ClassLoader classLoader); @Override Configuration createConfiguration(ConfigurationContext context); @Override ConfigurationBuilder getConfigurationBuilder(); @Override void setConfiguration(Configuration config, ClassLoader classLoader); @Override Configuration releaseConfiguration(ClassLoader classloader); @Override boolean isConfigurationSettable(ClassLoader classLoader);  }
@SuppressWarnings("deprecation") @Test public void setConfiguration() throws Exception { assertThatCode(() -> new CoreConfigurationProvider() .setConfiguration(new CoreConfigurationProvider().getConfiguration( getClass().getClassLoader()), getClass().getClassLoader() )).doesNotThrowAnyException(); }