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
51b56782
Commit
51b56782
authored
Nov 24, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply customizers to build when created embedded Mongo client
Closes gh-11132
parent
45e8c237
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
ReactiveMongoClientFactory.java
.../boot/autoconfigure/mongo/ReactiveMongoClientFactory.java
+1
-0
ReactiveMongoClientFactoryTests.java
.../autoconfigure/mongo/ReactiveMongoClientFactoryTests.java
+10
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactory.java
View file @
51b56782
...
...
@@ -92,6 +92,7 @@ public class ReactiveMongoClientFactory {
ClusterSettings
clusterSettings
=
ClusterSettings
.
builder
()
.
hosts
(
Collections
.
singletonList
(
new
ServerAddress
(
host
,
port
))).
build
();
builder
.
clusterSettings
(
clusterSettings
);
customize
(
builder
);
return
MongoClients
.
create
(
builder
.
build
());
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactoryTests.java
View file @
51b56782
...
...
@@ -161,6 +161,16 @@ public class ReactiveMongoClientFactoryTests {
verify
(
customizer
).
customize
(
any
(
MongoClientSettings
.
Builder
.
class
));
}
@Test
public
void
customizerIsInvokedForEmbeddedMongo
()
{
MongoProperties
properties
=
new
MongoProperties
();
this
.
environment
.
setProperty
(
"local.mongo.port"
,
"27017"
);
MongoClientSettingsBuilderCustomizer
customizer
=
mock
(
MongoClientSettingsBuilderCustomizer
.
class
);
createMongoClient
(
properties
,
this
.
environment
,
customizer
);
verify
(
customizer
).
customize
(
any
(
MongoClientSettings
.
Builder
.
class
));
}
private
MongoClient
createMongoClient
(
MongoProperties
properties
)
{
return
createMongoClient
(
properties
,
this
.
environment
);
}
...
...
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