Migrates from Bootstrapper to BootstrapRegistryInitializer

This commit is contained in:
spencergibb
2021-07-15 14:33:08 -04:00
parent a2f1f36d72
commit 8bc93b74cc
3 changed files with 8 additions and 7 deletions

View File

@@ -16,7 +16,7 @@
package org.springframework.cloud.vault.config;
import org.springframework.boot.Bootstrapper;
import org.springframework.boot.BootstrapRegistryInitializer;
import org.springframework.util.Assert;
/**
@@ -32,11 +32,12 @@ public abstract class VaultBootstrapper {
}
/**
* Create a {@link Bootstrapper} that configures a {@link VaultConfigurer}.
* Create a {@link BootstrapRegistryInitializer} that configures a
* {@link VaultConfigurer}.
* @param configurer the configurer to apply.
* @return the bootstrapper object.
*/
public static Bootstrapper fromConfigurer(VaultConfigurer configurer) {
public static BootstrapRegistryInitializer fromConfigurer(VaultConfigurer configurer) {
Assert.notNull(configurer, "VaultConfigurer must not be null");

View File

@@ -31,7 +31,7 @@ import org.apache.commons.logging.Log;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.boot.BootstrapContext;
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.Bootstrapper;
import org.springframework.boot.BootstrapRegistryInitializer;
import org.springframework.boot.ConfigurableBootstrapContext;
import org.springframework.boot.context.config.ConfigData;
import org.springframework.boot.context.config.ConfigDataLoader;
@@ -82,7 +82,7 @@ import static org.springframework.vault.config.AbstractVaultConfiguration.Client
* {@link VaultReactiveAutoConfiguration}.
* <p>
* Infrastructure beans can be customized by registering instances through
* {@link Bootstrapper}.
* {@link BootstrapRegistryInitializer}.
*
* @author Mark Paluch
* @since 3.0

View File

@@ -52,8 +52,8 @@ public class VaultBootstrapperIntegrationTests extends IntegrationTestSupport {
SpringApplication application = new SpringApplication(Config.class);
application.setWebApplicationType(WebApplicationType.NONE);
application
.addBootstrapper(VaultBootstrapper.fromConfigurer(configurer -> configurer.add("secret/customized")));
application.addBootstrapRegistryInitializer(
VaultBootstrapper.fromConfigurer(configurer -> configurer.add("secret/customized")));
this.context = application.run("--spring.application.name=VaultBootstrapPropertySourceConfigurationTests",
"--spring.config.import=vault:", "--spring.cloud.vault.token=" + Settings.token().getToken());