Polish
This commit is contained in:
@@ -20,7 +20,8 @@ import io.searchbox.client.config.HttpClientConfig;
|
||||
|
||||
/**
|
||||
* Callback interface that can be implemented by beans wishing to further customize the
|
||||
* {@link HttpClientConfig} via {@link HttpClientConfig.Builder} retaining its default
|
||||
* {@link io.searchbox.client.config.HttpClientConfig} via
|
||||
* {@link io.searchbox.client.config.HttpClientConfig.Builder} retaining its default
|
||||
* auto-configuration.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
@@ -29,7 +30,7 @@ import io.searchbox.client.config.HttpClientConfig;
|
||||
public interface HttpClientConfigBuilderCustomizer {
|
||||
|
||||
/**
|
||||
* Customize the {@link HttpClientConfig.Builder}.
|
||||
* Customize the {@link io.searchbox.client.config.HttpClientConfig.Builder}.
|
||||
* @param builder the builder to customize
|
||||
*/
|
||||
void customize(HttpClientConfig.Builder builder);
|
||||
|
||||
@@ -88,10 +88,11 @@ public class JestAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
public void customizerOverridesAutoConfig() {
|
||||
load(BuilderCustomizer.class, "spring.elasticsearch.jest.uris=http://localhost:9200");
|
||||
load(BuilderCustomizer.class,
|
||||
"spring.elasticsearch.jest.uris=http://localhost:9200");
|
||||
JestHttpClient client = (JestHttpClient) this.context.getBean(JestClient.class);
|
||||
assertThat(client.getGson()).isSameAs(
|
||||
this.context.getBean(BuilderCustomizer.class).getGson());
|
||||
assertThat(client.getGson())
|
||||
.isSameAs(this.context.getBean(BuilderCustomizer.class).getGson());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -166,10 +167,12 @@ public class JestAutoConfigurationTests {
|
||||
@Bean
|
||||
public HttpClientConfigBuilderCustomizer customizer() {
|
||||
return new HttpClientConfigBuilderCustomizer() {
|
||||
|
||||
@Override
|
||||
public void customize(HttpClientConfig.Builder builder) {
|
||||
builder.gson(BuilderCustomizer.this.gson);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user