Refactor Jest auto-configuration package space
This commit moves the Jest auto-configuration from `spring.jest` to `spring.elasticsearch.jest` Closes gh-6032
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.jest;
|
||||
package org.springframework.boot.autoconfigure.elasticsearch.jest;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.searchbox.client.JestClient;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.jest;
|
||||
package org.springframework.boot.autoconfigure.elasticsearch.jest;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -27,7 +27,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.4.0
|
||||
*/
|
||||
@ConfigurationProperties("spring.jest")
|
||||
@ConfigurationProperties("spring.elasticsearch.jest")
|
||||
public class JestProperties {
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for Jest.
|
||||
*/
|
||||
package org.springframework.boot.autoconfigure.elasticsearch.jest;
|
||||
@@ -37,6 +37,7 @@ org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.h2.H2ConsoleAutoConfiguration,\
|
||||
@@ -50,7 +51,6 @@ org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jest.JestAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration,\
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.jest;
|
||||
package org.springframework.boot.autoconfigure.elasticsearch.jest;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.searchbox.client.JestClient;
|
||||
@@ -55,13 +55,13 @@ public class JestAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
public void customJestClient() {
|
||||
load(CustomJestClient.class, "spring.jest.uris=http://localhost:9200");
|
||||
load(CustomJestClient.class, "spring.elasticsearch.jest.uris=http://localhost:9200");
|
||||
assertThat(this.context.getBeansOfType(JestClient.class)).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void customGson() {
|
||||
load(CustomGson.class, "spring.jest.uris=http://localhost:9200");
|
||||
load(CustomGson.class, "spring.elasticsearch.jest.uris=http://localhost:9200");
|
||||
JestHttpClient client = (JestHttpClient) this.context.getBean(JestClient.class);
|
||||
assertThat(client.getGson()).isSameAs(this.context.getBean("customGson"));
|
||||
}
|
||||
Reference in New Issue
Block a user