From 12ffaf100532ab0b7de8d21746040a95d4aa9c5d Mon Sep 17 00:00:00 2001 From: Olga MaciaszekSharma Date: Thu, 15 Jul 2021 16:21:17 +0200 Subject: [PATCH] Fix checkstyle and outdated API use. --- .../eureka/config/EurekaConfigServerBootstrapper.java | 6 +++--- .../src/main/resources/META-INF/spring.factories | 2 +- .../eureka/config/EurekaConfigServerBootstrapperTests.java | 4 ++-- .../netflix/eureka/http/EurekaServerMockApplication.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapper.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapper.java index 58ce2c096..ce5978f91 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapper.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapper.java @@ -19,7 +19,7 @@ package org.springframework.cloud.netflix.eureka.config; import com.netflix.discovery.shared.transport.EurekaHttpClient; import org.springframework.boot.BootstrapRegistry; -import org.springframework.boot.Bootstrapper; +import org.springframework.boot.BootstrapRegistryInitializer; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.cloud.config.client.ConfigClientProperties; import org.springframework.cloud.config.client.ConfigServerInstanceProvider; @@ -30,10 +30,10 @@ import org.springframework.cloud.netflix.eureka.http.EurekaClientHttpRequestFact import org.springframework.cloud.netflix.eureka.http.RestTemplateTransportClientFactory; import org.springframework.util.ClassUtils; -public class EurekaConfigServerBootstrapper implements Bootstrapper { +public class EurekaConfigServerBootstrapper implements BootstrapRegistryInitializer { @Override - public void intitialize(BootstrapRegistry registry) { + public void initialize(BootstrapRegistry registry) { if (!ClassUtils.isPresent("org.springframework.cloud.config.client.ConfigServerInstanceProvider", null)) { return; } diff --git a/spring-cloud-netflix-eureka-client/src/main/resources/META-INF/spring.factories b/spring-cloud-netflix-eureka-client/src/main/resources/META-INF/spring.factories index 5abd9d067..8ff70e92f 100644 --- a/spring-cloud-netflix-eureka-client/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-netflix-eureka-client/src/main/resources/META-INF/spring.factories @@ -9,5 +9,5 @@ org.springframework.cloud.netflix.eureka.loadbalancer.LoadBalancerEurekaAutoConf org.springframework.cloud.bootstrap.BootstrapConfiguration=\ org.springframework.cloud.netflix.eureka.config.EurekaConfigServerBootstrapConfiguration -org.springframework.boot.Bootstrapper=\ +org.springframework.boot.BootstrapRegistryInitializer=\ org.springframework.cloud.netflix.eureka.config.EurekaConfigServerBootstrapper diff --git a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapperTests.java b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapperTests.java index 4c6970885..3e1cbeb0b 100644 --- a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapperTests.java +++ b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapperTests.java @@ -31,7 +31,7 @@ public class EurekaConfigServerBootstrapperTests { public void notEnabledDoesNotAddInstanceProviderFn() { new SpringApplicationBuilder(TestConfig.class) .properties("spring.cloud.service-registry.auto-registration.enabled=false") - .addBootstrapper(registry -> registry.addCloseListener(event -> { + .addBootstrapRegistryInitializer(registry -> registry.addCloseListener(event -> { ConfigServerInstanceProvider.Function providerFn = event.getBootstrapContext() .get(ConfigServerInstanceProvider.Function.class); assertThat(providerFn).as("ConfigServerInstanceProvider.Function was created when it shouldn't") @@ -44,7 +44,7 @@ public class EurekaConfigServerBootstrapperTests { new SpringApplicationBuilder(TestConfig.class) .properties("spring.cloud.config.discovery.enabled=true", "spring.cloud.service-registry.auto-registration.enabled=false") - .addBootstrapper(registry -> registry.addCloseListener(event -> { + .addBootstrapRegistryInitializer(registry -> registry.addCloseListener(event -> { ConfigServerInstanceProvider.Function providerFn = event.getBootstrapContext() .get(ConfigServerInstanceProvider.Function.class); assertThat(providerFn).as("ConfigServerInstanceProvider.Function was not created when it should.") diff --git a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/EurekaServerMockApplication.java b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/EurekaServerMockApplication.java index 9d5250220..d72eb8729 100644 --- a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/EurekaServerMockApplication.java +++ b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/EurekaServerMockApplication.java @@ -86,7 +86,7 @@ public class EurekaServerMockApplication { /** * Simulates Eureka Server own's serialization. - * @return + * @return converter */ @Bean public MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter() {