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
e844c924
Commit
e844c924
authored
Jul 14, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose AssertionErrors as is
Closes gh-9760
parent
51c2b049
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
AbstractContextLoader.java
...ingframework/boot/test/context/AbstractContextLoader.java
+1
-1
StandardContextLoaderTests.java
...amework/boot/test/context/StandardContextLoaderTests.java
+12
-0
No files found.
spring-boot-test/src/main/java/org/springframework/boot/test/context/AbstractContextLoader.java
View file @
e844c924
...
@@ -186,7 +186,7 @@ class AbstractContextLoader<T extends ConfigurableApplicationContext, L extends
...
@@ -186,7 +186,7 @@ class AbstractContextLoader<T extends ConfigurableApplicationContext, L extends
T
ctx
=
handler
.
load
();
T
ctx
=
handler
.
load
();
contextHandler
.
handle
(
ctx
);
contextHandler
.
handle
(
ctx
);
}
}
catch
(
RuntimeException
ex
)
{
catch
(
RuntimeException
|
AssertionError
ex
)
{
throw
ex
;
throw
ex
;
}
}
catch
(
Throwable
ex
)
{
catch
(
Throwable
ex
)
{
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/context/StandardContextLoaderTests.java
View file @
e844c924
...
@@ -194,6 +194,18 @@ public class StandardContextLoaderTests {
...
@@ -194,6 +194,18 @@ public class StandardContextLoaderTests {
});
});
}
}
@Test
public
void
assertionErrorsAreAvailableAsIs
()
{
try
{
this
.
contextLoader
.
load
(
context
->
{
fail
(
"This is expected"
);
});
}
catch
(
AssertionError
ex
)
{
assertThat
(
ex
.
getMessage
()).
isEqualTo
(
"This is expected"
);
}
}
@Configuration
@Configuration
static
class
ConfigA
{
static
class
ConfigA
{
...
...
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