Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
4d031999
Commit
4d031999
authored
Sep 06, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Fix use of deprecated Mongo API"
Closes gh-14318
parent
b97892ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
ReactiveMongoClientFactory.java
.../boot/autoconfigure/mongo/ReactiveMongoClientFactory.java
+2
-2
MongoReactiveAutoConfigurationTests.java
...oconfigure/mongo/MongoReactiveAutoConfigurationTests.java
+1
-1
ReactiveMongoClientFactoryTests.java
.../autoconfigure/mongo/ReactiveMongoClientFactoryTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactory.java
View file @
4d031999
...
...
@@ -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
);
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java
View file @
4d031999
...
...
@@ -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
();
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactoryTests.java
View file @
4d031999
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment