|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2022 the original author or authors.
|
|
|
|
* Copyright 2012-2023 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -23,6 +23,7 @@ import co.elastic.clients.json.jackson.JacksonJsonpMapper;
|
|
|
|
import co.elastic.clients.json.jsonb.JsonbJsonpMapper;
|
|
|
|
import co.elastic.clients.json.jsonb.JsonbJsonpMapper;
|
|
|
|
import co.elastic.clients.transport.ElasticsearchTransport;
|
|
|
|
import co.elastic.clients.transport.ElasticsearchTransport;
|
|
|
|
import co.elastic.clients.transport.rest_client.RestClientTransport;
|
|
|
|
import co.elastic.clients.transport.rest_client.RestClientTransport;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import org.elasticsearch.client.RestClient;
|
|
|
|
import org.elasticsearch.client.RestClient;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
|
|
|
@ -108,6 +109,16 @@ class ElasticsearchClientAutoConfigurationTests {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
void jacksonJsonpMapperDoesNotUseGlobalObjectMapper() {
|
|
|
|
|
|
|
|
this.contextRunner.withConfiguration(AutoConfigurations.of(JacksonAutoConfiguration.class))
|
|
|
|
|
|
|
|
.withUserConfiguration(RestClientConfiguration.class).run((context) -> {
|
|
|
|
|
|
|
|
ObjectMapper objectMapper = context.getBean(ObjectMapper.class);
|
|
|
|
|
|
|
|
JacksonJsonpMapper jacksonJsonpMapper = context.getBean(JacksonJsonpMapper.class);
|
|
|
|
|
|
|
|
assertThat(jacksonJsonpMapper.objectMapper()).isNotSameAs(objectMapper);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
static class RestClientConfiguration {
|
|
|
|
static class RestClientConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|