Merge branch '1.5.x'

This commit is contained in:
Phillip Webb
2016-12-27 15:06:22 -08:00
46 changed files with 313 additions and 171 deletions

View File

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

View File

@@ -57,11 +57,11 @@ public class CustomRestTemplateBasicOAuth2SsoConfigurationTests {
private ApplicationContext applicationContext;
@Autowired
private ObjectProvider<RestTemplate> restTemplateProvider;
private ObjectProvider<RestTemplate> restTemplate;
@Test
public void customRestTemplateCanBePrimary() {
RestTemplate restTemplate = this.restTemplateProvider.getIfAvailable();
RestTemplate restTemplate = this.restTemplate.getIfAvailable();
verifyZeroInteractions(restTemplate);
assertThat(this.applicationContext.getBeansOfType(RestTemplate.class)).hasSize(1);
}