Fix checkstyle and outdated API use.

This commit is contained in:
Olga MaciaszekSharma
2021-07-15 16:21:17 +02:00
parent 2b10f19d1a
commit 12ffaf1005
4 changed files with 7 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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.")

View File

@@ -86,7 +86,7 @@ public class EurekaServerMockApplication {
/**
* Simulates Eureka Server own's serialization.
* @return
* @return converter
*/
@Bean
public MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter() {