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
3d99a5dd
Commit
3d99a5dd
authored
May 26, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for inaccessible configuration class
See gh-948
parent
f1f36cd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
SpringApplicationTests.java
...java/org/springframework/boot/SpringApplicationTests.java
+16
-1
No files found.
spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java
View file @
3d99a5dd
...
...
@@ -110,6 +110,13 @@ public class SpringApplicationTests {
new
SpringApplication
().
run
();
}
@Test
public
void
sourcesMustBeAccessible
()
throws
Exception
{
this
.
thrown
.
expect
(
IllegalStateException
.
class
);
this
.
thrown
.
expectMessage
(
"Cannot load configuration"
);
new
SpringApplication
(
InaccessibleConfiguration
.
class
).
run
();
}
@Test
public
void
disableBanner
()
throws
Exception
{
SpringApplication
application
=
spy
(
new
SpringApplication
(
ExampleConfig
.
class
));
...
...
@@ -269,7 +276,7 @@ public class SpringApplicationTests {
}
@Test
public
void
proprtiesFileEnhancesEnvironment
()
throws
Exception
{
public
void
prop
e
rtiesFileEnhancesEnvironment
()
throws
Exception
{
SpringApplication
application
=
new
SpringApplication
(
ExampleConfig
.
class
);
application
.
setWebEnvironment
(
false
);
ConfigurableEnvironment
environment
=
new
StandardEnvironment
();
...
...
@@ -468,6 +475,14 @@ public class SpringApplicationTests {
return
false
;
}
@Configuration
protected
static
class
InaccessibleConfiguration
{
private
InaccessibleConfiguration
()
{
}
}
public
static
class
SpyApplicationContext
extends
AnnotationConfigApplicationContext
{
ConfigurableApplicationContext
applicationContext
=
spy
(
new
AnnotationConfigApplicationContext
());
...
...
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