Skip to content

Polish #24837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Polish #24837

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static class JacksonConfiguration {

@Bean
@ConditionalOnSingleCandidate(ObjectMapper.class)
ClusterEnvironmentBuilderCustomizer cluster(ObjectMapper objectMapper) {
ClusterEnvironmentBuilderCustomizer jacksonClusterEnvironmentBuilderCustomizer(ObjectMapper objectMapper) {
return new JacksonClusterEnvironmentBuilderCustomizer(objectMapper);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ static class RestClientSnifferConfiguration {
@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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,12 @@ void configureWithCustomSnifferSettings() {
@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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8461,7 +8461,7 @@ The following example shows how to use the `ConditionEvaluationReportLoggingList
[source,java,indent=0]
----
@Test
public void autoConfigTest {
void autoConfigTest() {
ConditionEvaluationReportLoggingListener initializer = new ConditionEvaluationReportLoggingListener(
LogLevel.INFO);
ApplicationContextRunner contextRunner = new ApplicationContextRunner()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private Integer getLocalPort(Connector connector) {
.invokeMethod(ReflectionUtils.findMethod(connector.getClass(), "getLocalPort"), connector);
}
catch (Exception ex) {
logger.info("could not determine port ( " + ex.getMessage() + ")");
logger.info("could not determine port (" + ex.getMessage() + ")");
}
return 0;
}
Expand Down