Commit 4d031999 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Fix use of deprecated Mongo API"

Closes gh-14318
parent b97892ff
......@@ -83,7 +83,7 @@ public class ReactiveMongoClientFactory {
Builder builder = builder(settings);
String host = (this.properties.getHost() != null) ? this.properties.getHost()
: "localhost";
builder.applyToClusterSettings(cluster -> cluster
builder.applyToClusterSettings((cluster) -> cluster
.hosts(Collections.singletonList(new ServerAddress(host, port))));
return createMongoClient(builder);
}
......@@ -108,7 +108,7 @@ public class ReactiveMongoClientFactory {
int port = getOrDefault(this.properties.getPort(), MongoProperties.DEFAULT_PORT);
ServerAddress serverAddress = new ServerAddress(host, port);
builder.applyToClusterSettings(
cluster -> cluster.hosts(Collections.singletonList(serverAddress)));
(cluster) -> cluster.hosts(Collections.singletonList(serverAddress)));
return createMongoClient(builder);
}
......
......@@ -121,7 +121,7 @@ public class MongoReactiveAutoConfigurationTests {
public MongoClientSettings mongoClientSettings() {
return MongoClientSettings.builder().readPreference(ReadPreference.nearest())
.applyToSocketSettings(
socket -> socket.readTimeout(300, TimeUnit.SECONDS))
(socket) -> socket.readTimeout(300, TimeUnit.SECONDS))
.build();
}
......
......@@ -19,9 +19,9 @@ package org.springframework.boot.autoconfigure.mongo;
import java.util.Arrays;
import java.util.List;
import com.mongodb.MongoClientSettings;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import com.mongodb.MongoClientSettings;
import com.mongodb.connection.ClusterSettings;
import com.mongodb.reactivestreams.client.MongoClient;
import org.junit.Rule;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment