diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java index a4c55840f6..9f6cc4ebc6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java @@ -124,7 +124,7 @@ public class CouchbaseAutoConfiguration { @Bean @ConditionalOnSingleCandidate(ObjectMapper.class) - ClusterEnvironmentBuilderCustomizer cluster(ObjectMapper objectMapper) { + ClusterEnvironmentBuilderCustomizer jacksonClusterEnvironmentBuilderCustomizer(ObjectMapper objectMapper) { return new JacksonClusterEnvironmentBuilderCustomizer(objectMapper); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientConfigurations.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientConfigurations.java index 78957d586c..12056b4867 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientConfigurations.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientConfigurations.java @@ -119,10 +119,10 @@ class ElasticsearchRestClientConfigurations { @ConditionalOnMissingBean Sniffer elasticsearchSniffer(RestHighLevelClient client, ElasticsearchRestClientProperties properties) { SnifferBuilder builder = Sniffer.builder(client.getLowLevelClient()); - PropertyMapper get = PropertyMapper.get().alwaysApplyingWhenNonNull(); - get.from(properties.getSniffer().getInterval()).asInt(Duration::toMillis) + PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); + map.from(properties.getSniffer().getInterval()).asInt(Duration::toMillis) .to(builder::setSniffIntervalMillis); - get.from(properties.getSniffer().getDelayAfterFailure()).asInt(Duration::toMillis) + map.from(properties.getSniffer().getDelayAfterFailure()).asInt(Duration::toMillis) .to(builder::setSniffAfterFailureDelayMillis); return builder.build(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientAutoConfigurationTests.java index 47110d7f4c..8d5a55a613 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientAutoConfigurationTests.java @@ -248,15 +248,12 @@ class ElasticsearchRestClientAutoConfigurationTests { @Test void configureWhenCustomSnifferShouldBackOff() { Sniffer customSniffer = mock(Sniffer.class); - this.contextRunner.withBean(Sniffer.class, () -> customSniffer) - .withPropertyValues("spring.elasticsearch.rest.sniffer.interval=180s", - "spring.elasticsearch.rest.sniffer.delay-after-failure=30s") - .run((context) -> { - assertThat(context).hasSingleBean(Sniffer.class); - Sniffer sniffer = context.getBean(Sniffer.class); - assertThat(sniffer).isSameAs(customSniffer); - verifyNoInteractions(customSniffer); - }); + this.contextRunner.withBean(Sniffer.class, () -> customSniffer).run((context) -> { + assertThat(context).hasSingleBean(Sniffer.class); + Sniffer sniffer = context.getBean(Sniffer.class); + assertThat(sniffer).isSameAs(customSniffer); + verifyNoInteractions(customSniffer); + }); } @Configuration(proxyBeanMethods = false)