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
8899b93d
Commit
8899b93d
authored
Feb 07, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
8e920075
45a91fca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
AutoConfigurationImportSelector.java
...k/boot/autoconfigure/AutoConfigurationImportSelector.java
+3
-2
AutoConfigurationImportSelectorTests.java
...t/autoconfigure/AutoConfigurationImportSelectorTests.java
+13
-5
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java
View file @
8899b93d
...
...
@@ -20,6 +20,7 @@ import java.io.IOException;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -222,8 +223,8 @@ public class AutoConfigurationImportSelector
String
name
=
entry
.
getKey
();
Object
value
=
entry
.
getValue
();
if
(
name
.
isEmpty
()
||
name
.
startsWith
(
"["
)
&&
value
!=
null
)
{
excludes
.
addAll
(
StringUtils
.
commaDelimitedListToSet
(
String
.
valueOf
(
value
)));
excludes
.
addAll
(
new
HashSet
<
String
>(
Arrays
.
asList
(
StringUtils
.
tokenizeToStringArray
(
String
.
valueOf
(
value
),
","
)
)));
}
}
return
excludes
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java
View file @
8899b93d
...
...
@@ -130,11 +130,15 @@ public class AutoConfigurationImportSelectorTests {
this
.
environment
.
setProperty
(
"spring.autoconfigure.exclude"
,
FreeMarkerAutoConfiguration
.
class
.
getName
()
+
","
+
MustacheAutoConfiguration
.
class
.
getName
());
String
[]
imports
=
selectImports
(
BasicEnableAutoConfiguration
.
class
);
assertThat
(
imports
).
hasSize
(
getAutoConfigurationClassNames
().
size
()
-
2
);
assertThat
(
this
.
importSelector
.
getLastEvent
().
getExclusions
()).
contains
(
FreeMarkerAutoConfiguration
.
class
.
getName
(),
MustacheAutoConfiguration
.
class
.
getName
());
testSeveralPropertyExclusionsAreApplied
();
}
@Test
public
void
severalPropertyExclusionsAreAppliedWithExtraSpaces
()
{
this
.
environment
.
setProperty
(
"spring.autoconfigure.exclude"
,
FreeMarkerAutoConfiguration
.
class
.
getName
()
+
" , "
+
MustacheAutoConfiguration
.
class
.
getName
()
+
" "
);
testSeveralPropertyExclusionsAreApplied
();
}
@Test
...
...
@@ -143,6 +147,10 @@ public class AutoConfigurationImportSelectorTests {
FreeMarkerAutoConfiguration
.
class
.
getName
());
this
.
environment
.
setProperty
(
"spring.autoconfigure.exclude[1]"
,
MustacheAutoConfiguration
.
class
.
getName
());
testSeveralPropertyExclusionsAreApplied
();
}
private
void
testSeveralPropertyExclusionsAreApplied
()
{
String
[]
imports
=
selectImports
(
BasicEnableAutoConfiguration
.
class
);
assertThat
(
imports
).
hasSize
(
getAutoConfigurationClassNames
().
size
()
-
2
);
assertThat
(
this
.
importSelector
.
getLastEvent
().
getExclusions
()).
contains
(
...
...
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