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
d92441e5
Commit
d92441e5
authored
Aug 02, 2018
by
Johnny Lim
Committed by
Stephane Nicoll
Aug 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update assertion message in AnnotatedClassFinder.scanPackage()
Closes gh-13989
parent
b9fcb6a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
AnnotatedClassFinder.java
...ringframework/boot/test/context/AnnotatedClassFinder.java
+5
-2
No files found.
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/AnnotatedClassFinder.java
View file @
d92441e5
...
...
@@ -41,6 +41,8 @@ public final class AnnotatedClassFinder {
private
static
final
Map
<
String
,
Class
<?>>
cache
=
Collections
.
synchronizedMap
(
new
Cache
(
40
));
private
final
Class
<?
extends
Annotation
>
annotationType
;
private
final
ClassPathScanningCandidateComponentProvider
scanner
;
/**
...
...
@@ -49,6 +51,7 @@ public final class AnnotatedClassFinder {
*/
public
AnnotatedClassFinder
(
Class
<?
extends
Annotation
>
annotationType
)
{
Assert
.
notNull
(
annotationType
,
"AnnotationType must not be null"
);
this
.
annotationType
=
annotationType
;
this
.
scanner
=
new
ClassPathScanningCandidateComponentProvider
(
false
);
this
.
scanner
.
addIncludeFilter
(
new
AnnotationTypeFilter
(
annotationType
));
this
.
scanner
.
setResourcePattern
(
"*.class"
);
...
...
@@ -88,8 +91,8 @@ public final class AnnotatedClassFinder {
Set
<
BeanDefinition
>
components
=
this
.
scanner
.
findCandidateComponents
(
source
);
if
(!
components
.
isEmpty
())
{
Assert
.
state
(
components
.
size
()
==
1
,
()
->
"Found multiple @
SpringBootConfiguration annotated classes "
+
components
);
()
->
"Found multiple @
"
+
this
.
annotationType
.
getSimpleName
()
+
" annotated classes "
+
components
);
return
ClassUtils
.
resolveClassName
(
components
.
iterator
().
next
().
getBeanClassName
(),
null
);
}
...
...
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