Merge branch 'lovelace-upgrade'

pull/13174/merge
Andy Wilkinson 7 years ago
commit 1f551e9e9c

@ -18,8 +18,10 @@ package org.springframework.boot.autoconfigure.data.mongo;
import java.util.Collections;
import com.mongodb.ClientSessionOptions;
import com.mongodb.DB;
import com.mongodb.MongoClient;
import com.mongodb.client.ClientSession;
import com.mongodb.client.MongoDatabase;
import org.springframework.beans.BeanUtils;
@ -182,6 +184,16 @@ public class MongoDataAutoConfiguration {
return this.mongoDbFactory.getLegacyDb();
}
@Override
public ClientSession getSession(ClientSessionOptions options) {
return this.mongoDbFactory.getSession(options);
}
@Override
public MongoDbFactory withSession(ClientSession session) {
return this.mongoDbFactory.withSession(session);
}
}
}

@ -62,12 +62,13 @@ public class RestClientAutoConfiguration {
@Bean(destroyMethod = "close")
@ConditionalOnMissingBean
public RestClient restClient() {
RestClientBuilder builder = configureBuilder();
public RestClient restClient(RestClientBuilder builder) {
return builder.build();
}
protected RestClientBuilder configureBuilder() {
@Bean
@ConditionalOnMissingBean
public RestClientBuilder restClientBuilder() {
HttpHost[] hosts = this.properties.getUris().stream().map(HttpHost::create)
.toArray(HttpHost[]::new);
RestClientBuilder builder = RestClient.builder(hosts);
@ -90,8 +91,9 @@ public class RestClientAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public RestHighLevelClient restHighLevelClient(RestClient restClient) {
return new RestHighLevelClient(restClient);
public RestHighLevelClient restHighLevelClient(
RestClientBuilder restClientBuilder) {
return new RestHighLevelClient(restClientBuilder);
}
}

@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisClusterConfiguration;
import org.springframework.data.redis.connection.RedisNode;
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
@ -231,9 +232,17 @@ public class RedisAutoConfigurationTests {
.withPropertyValues(
"spring.redis.cluster.nodes[0]:" + clusterNodes.get(0),
"spring.redis.cluster.nodes[1]:" + clusterNodes.get(1))
.run((context) -> assertThat(context
.getBean(LettuceConnectionFactory.class).getClusterConnection())
.isNotNull());
.run((context) -> {
RedisClusterConfiguration clusterConfiguration = context
.getBean(LettuceConnectionFactory.class)
.getClusterConfiguration();
assertThat(clusterConfiguration.getClusterNodes()).hasSize(2);
assertThat(clusterConfiguration.getClusterNodes())
.extracting((node) -> node.getHost() + ":" + node.getPort())
.containsExactlyInAnyOrder("127.0.0.1:27379",
"127.0.0.1:27380");
});
}
@Test

@ -42,7 +42,7 @@
<bitronix.version>2.1.4</bitronix.version>
<byte-buddy.version>1.7.11</byte-buddy.version>
<caffeine.version>2.6.2</caffeine.version>
<cassandra-driver.version>3.4.0</cassandra-driver.version>
<cassandra-driver.version>3.5.0</cassandra-driver.version>
<classmate.version>1.3.4</classmate.version>
<commons-codec.version>1.11</commons-codec.version>
<commons-dbcp2.version>2.2.0</commons-dbcp2.version>
@ -59,7 +59,7 @@
<embedded-mongo.version>2.0.3</embedded-mongo.version>
<flyway.version>5.0.7</flyway.version>
<freemarker.version>2.3.28</freemarker.version>
<elasticsearch.version>5.6.9</elasticsearch.version>
<elasticsearch.version>6.2.4</elasticsearch.version>
<glassfish-el.version>3.0.0</glassfish-el.version>
<groovy.version>2.4.15</groovy.version>
<gson.version>2.8.4</gson.version>
@ -116,7 +116,7 @@
<junit-platform.version>1.1.0</junit-platform.version>
<kafka.version>1.1.0</kafka.version>
<kotlin.version>1.2.41</kotlin.version>
<lettuce.version>5.0.4.RELEASE</lettuce.version>
<lettuce.version>5.1.0.M1</lettuce.version>
<liquibase.version>3.6.1</liquibase.version>
<log4j2.version>2.10.0</log4j2.version>
<logback.version>1.2.3</logback.version>
@ -124,8 +124,8 @@
<mariadb.version>2.2.3</mariadb.version>
<micrometer.version>1.0.4</micrometer.version>
<mockito.version>2.18.3</mockito.version>
<mongo-driver-reactivestreams.version>1.7.1</mongo-driver-reactivestreams.version>
<mongodb.version>3.6.3</mongodb.version>
<mongo-driver-reactivestreams.version>1.9.0-beta1</mongo-driver-reactivestreams.version>
<mongodb.version>3.8.0-beta2</mongodb.version>
<mssql-jdbc.version>6.2.2.jre8</mssql-jdbc.version>
<mysql.version>5.1.46</mysql.version>
<narayana.version>5.8.1.Final</narayana.version>
@ -150,12 +150,12 @@
<simple-json.version>1.1.1</simple-json.version>
<slf4j.version>1.7.25</slf4j.version>
<snakeyaml.version>1.19</snakeyaml.version>
<solr.version>6.6.3</solr.version>
<solr.version>7.2.1</solr.version>
<spring.version>5.0.6.RELEASE</spring.version>
<spring-amqp.version>2.0.3.RELEASE</spring-amqp.version>
<spring-batch.version>4.0.1.RELEASE</spring-batch.version>
<spring-cloud-connectors.version>2.0.1.RELEASE</spring-cloud-connectors.version>
<spring-data-releasetrain.version>Kay-SR7</spring-data-releasetrain.version>
<spring-data-releasetrain.version>Lovelace-BUILD-SNAPSHOT</spring-data-releasetrain.version>
<spring-hateoas.version>0.24.0.RELEASE</spring-hateoas.version>
<spring-integration.version>5.0.5.RELEASE</spring-integration.version>
<spring-kafka.version>2.2.0.BUILD-SNAPSHOT</spring-kafka.version>
@ -1531,6 +1531,11 @@
<artifactId>solr-langid</artifactId>
<version>${solr.version}</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-ltr</artifactId>
<version>${solr.version}</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>

Loading…
Cancel
Save