diff --git a/pom.xml b/pom.xml index 66b83efe..89d61664 100644 --- a/pom.xml +++ b/pom.xml @@ -20,12 +20,12 @@ - 3.1.2 + 3.1.3-SNAPSHOT 3.1.4-SNAPSHOT 3.1.4-SNAPSHOT 1.0.3.RELEASE 3.1.4-SNAPSHOT - 3.2.4 + 3.2.5-SNAPSHOT 1.15.1 diff --git a/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapper.java b/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapper.java index e8062b03..30a35d5d 100644 --- a/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapper.java +++ b/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapper.java @@ -101,7 +101,7 @@ public class ConsulConfigServerBootstrapper implements BootstrapRegistryInitiali private boolean isDiscoveryEnabled(Binder binder) { return binder.bind(ConfigClientProperties.CONFIG_DISCOVERY_ENABLED, Boolean.class).orElse(false) && binder.bind(ConditionalOnConsulDiscoveryEnabled.PROPERTY, Boolean.class).orElse(true) - && binder.bind("spring.cloud.discovery.enabled", Boolean.class).orElse(true); + && binder.bind("spring.cloud.discovery.enabled", Boolean.class).orElse(true); } } diff --git a/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapperTests.java b/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapperTests.java index 3c1a7b2d..dc1d61e9 100644 --- a/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapperTests.java +++ b/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapperTests.java @@ -70,15 +70,15 @@ public class ConsulConfigServerBootstrapperTests { @Test public void springCloudDiscoveryClientNotEnabledProvidesEmptyList() { new SpringApplicationBuilder(TestConfig.class) - .properties("--server.port=0", "spring.cloud.service-registry.auto-registration.enabled=false", - "spring.cloud.config.discovery.enabled=true", "spring.cloud.discovery.enabled=false") - .addBootstrapRegistryInitializer(registry -> registry.addCloseListener(event -> { - ConfigServerInstanceProvider.Function providerFn = event.getBootstrapContext() - .get(ConfigServerInstanceProvider.Function.class); - assertThat(providerFn.apply("id")) - .as("ConfigServerInstanceProvider.Function should return empty list") - .isEqualTo(Collections.EMPTY_LIST); - })).run().close(); + .properties("--server.port=0", "spring.cloud.service-registry.auto-registration.enabled=false", + "spring.cloud.config.discovery.enabled=true", "spring.cloud.discovery.enabled=false") + .addBootstrapRegistryInitializer(registry -> registry.addCloseListener(event -> { + ConfigServerInstanceProvider.Function providerFn = event.getBootstrapContext() + .get(ConfigServerInstanceProvider.Function.class); + assertThat(providerFn.apply("id")) + .as("ConfigServerInstanceProvider.Function should return empty list") + .isEqualTo(Collections.EMPTY_LIST); + })).run().close(); } @Test @@ -96,9 +96,9 @@ public class ConsulConfigServerBootstrapperTests { ConfigServerInstanceProvider.Function providerFn = event.getBootstrapContext() .get(ConfigServerInstanceProvider.Function.class); assertThatThrownBy(() -> providerFn.apply("id")).isInstanceOf(TransportException.class) - .hasMessageContaining("org.apache.http.conn.HttpHostConnectException: Connect to localhost:8500") - .as("Should have tried to reach out to Consul to get config server instance") - .isNotNull(); + .hasMessageContaining( + "org.apache.http.conn.HttpHostConnectException: Connect to localhost:8500") + .as("Should have tried to reach out to Consul to get config server instance").isNotNull(); })).run(); ConsulDiscoveryClient discoveryClient = context.getBean(ConsulDiscoveryClient.class); assertThat(discoveryClient == bootstrapDiscoveryClient.get()).isTrue();