Skip to content

Commit

Permalink
Polish "Fix use of deprecated Mongo API"
Browse files Browse the repository at this point in the history
Closes gh-14318
  • Loading branch information
snicoll committed Sep 6, 2018
1 parent b97892f commit 4d03199
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -83,7 +83,7 @@ private MongoClient createEmbeddedMongoClient(MongoClientSettings settings,
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);
}
Expand All @@ -108,7 +108,7 @@ private MongoClient createCredentialNetworkMongoClient(MongoClientSettings setti
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);
}

Expand Down
Expand Up @@ -121,7 +121,7 @@ static class OptionsConfig {
public MongoClientSettings mongoClientSettings() {
return MongoClientSettings.builder().readPreference(ReadPreference.nearest())
.applyToSocketSettings(
socket -> socket.readTimeout(300, TimeUnit.SECONDS))
(socket) -> socket.readTimeout(300, TimeUnit.SECONDS))
.build();
}

Expand Down
Expand Up @@ -19,9 +19,9 @@
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;
Expand Down

0 comments on commit 4d03199

Please sign in to comment.