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
e769f204
Commit
e769f204
authored
Apr 13, 2016
by
Johnny Lim
Committed by
Phillip Webb
Apr 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close the context in TypeExcludeFilterTests
Closes gh-5672
parent
bf1fcfc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
TypeExcludeFilterTests.java
.../springframework/boot/context/TypeExcludeFilterTests.java
+17
-8
No files found.
spring-boot/src/test/java/org/springframework/boot/context/TypeExcludeFilterTests.java
View file @
e769f204
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
package
org
.
springframework
.
boot
.
context
;
package
org
.
springframework
.
boot
.
context
;
import
org.junit.After
;
import
org.junit.Rule
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.rules.ExpectedException
;
import
org.junit.rules.ExpectedException
;
...
@@ -42,19 +43,27 @@ public class TypeExcludeFilterTests {
...
@@ -42,19 +43,27 @@ public class TypeExcludeFilterTests {
@Rule
@Rule
public
ExpectedException
thrown
=
ExpectedException
.
none
();
public
ExpectedException
thrown
=
ExpectedException
.
none
();
private
AnnotationConfigApplicationContext
context
;
@After
public
void
cleanUp
()
{
if
(
this
.
context
!=
null
)
{
this
.
context
.
close
();
}
}
@Test
@Test
public
void
loadsTypeExcludeFilters
()
throws
Exception
{
public
void
loadsTypeExcludeFilters
()
throws
Exception
{
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
=
new
AnnotationConfigApplicationContext
();
context
.
getBeanFactory
().
registerSingleton
(
"filter1"
,
this
.
context
.
getBeanFactory
().
registerSingleton
(
"filter1"
,
new
WithoutMatchOverrideFilter
());
new
WithoutMatchOverrideFilter
());
context
.
getBeanFactory
().
registerSingleton
(
"filter2"
,
this
.
context
.
getBeanFactory
().
registerSingleton
(
"filter2"
,
new
SampleTypeExcludeFilter
());
new
SampleTypeExcludeFilter
());
context
.
register
(
Config
.
class
);
this
.
context
.
register
(
Config
.
class
);
context
.
refresh
();
this
.
context
.
refresh
();
assertThat
(
context
.
getBean
(
ExampleComponent
.
class
)).
isNotNull
();
assertThat
(
this
.
context
.
getBean
(
ExampleComponent
.
class
)).
isNotNull
();
this
.
thrown
.
expect
(
NoSuchBeanDefinitionException
.
class
);
this
.
thrown
.
expect
(
NoSuchBeanDefinitionException
.
class
);
context
.
getBean
(
ExampleFilteredComponent
.
class
);
this
.
context
.
getBean
(
ExampleFilteredComponent
.
class
);
context
.
close
();
}
}
@Configuration
@Configuration
...
...
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