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
4d1fc196
Commit
4d1fc196
authored
Oct 05, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Windows-specific custom features so download URI is correct
Closes gh-14690
parent
bdd8e531
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
EmbeddedMongoAutoConfigurationTests.java
...e/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java
+14
-3
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java
View file @
4d1fc196
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
mongo
.
embedded
;
package
org
.
springframework
.
boot
.
autoconfigure
.
mongo
.
embedded
;
import
java.io.File
;
import
java.io.File
;
import
java.util.EnumSet
;
import
java.util.stream.Collectors
;
import
com.mongodb.MongoClient
;
import
com.mongodb.MongoClient
;
import
de.flapdoodle.embed.mongo.config.IMongodConfig
;
import
de.flapdoodle.embed.mongo.config.IMongodConfig
;
...
@@ -70,10 +72,15 @@ public class EmbeddedMongoAutoConfigurationTests {
...
@@ -70,10 +72,15 @@ public class EmbeddedMongoAutoConfigurationTests {
@Test
@Test
public
void
customFeatures
()
{
public
void
customFeatures
()
{
load
(
"spring.mongodb.embedded.features=TEXT_SEARCH, SYNC_DELAY, ONLY_WITH_SSL, NO_HTTP_INTERFACE_ARG"
);
EnumSet
<
Feature
>
features
=
EnumSet
.
of
(
Feature
.
TEXT_SEARCH
,
Feature
.
SYNC_DELAY
,
Feature
.
ONLY_WITH_SSL
,
Feature
.
NO_HTTP_INTERFACE_ARG
);
if
(
isWindows
())
{
features
.
add
(
Feature
.
ONLY_WINDOWS_2008_SERVER
);
}
load
(
"spring.mongodb.embedded.features="
+
String
.
join
(
", "
,
features
.
stream
().
map
(
Feature:
:
name
).
collect
(
Collectors
.
toList
())));
assertThat
(
this
.
context
.
getBean
(
EmbeddedMongoProperties
.
class
).
getFeatures
())
assertThat
(
this
.
context
.
getBean
(
EmbeddedMongoProperties
.
class
).
getFeatures
())
.
containsExactly
(
Feature
.
TEXT_SEARCH
,
Feature
.
SYNC_DELAY
,
.
containsExactlyElementsOf
(
features
);
Feature
.
ONLY_WITH_SSL
,
Feature
.
NO_HTTP_INTERFACE_ARG
);
}
}
@Test
@Test
...
@@ -193,6 +200,10 @@ public class EmbeddedMongoAutoConfigurationTests {
...
@@ -193,6 +200,10 @@ public class EmbeddedMongoAutoConfigurationTests {
this
.
context
=
ctx
;
this
.
context
=
ctx
;
}
}
private
boolean
isWindows
()
{
return
File
.
separatorChar
==
'\\'
;
}
@Configuration
@Configuration
static
class
MongoClientConfiguration
{
static
class
MongoClientConfiguration
{
...
...
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