Merge branch '1.5.x'
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user