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
1709e79c
Commit
1709e79c
authored
Oct 29, 2014
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1763 from sdeleuze/whitelabel-typo
* whitelabel-typo: Fix a typo in error.whitelabel.enabled
parents
741d1f72
7546f10a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
ErrorMvcAutoConfiguration.java
...ork/boot/autoconfigure/web/ErrorMvcAutoConfiguration.java
+1
-1
BasicErrorControllerDirectMockMvcTests.java
...configure/web/BasicErrorControllerDirectMockMvcTests.java
+18
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration.java
View file @
1709e79c
...
@@ -97,7 +97,7 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
...
@@ -97,7 +97,7 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
}
}
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"error.whitelab
le
"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
@ConditionalOnProperty
(
prefix
=
"error.whitelab
el
"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
@Conditional
(
ErrorTemplateMissingCondition
.
class
)
@Conditional
(
ErrorTemplateMissingCondition
.
class
)
protected
static
class
WhitelabelErrorViewConfiguration
{
protected
static
class
WhitelabelErrorViewConfiguration
{
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/BasicErrorControllerDirectMockMvcTests.java
View file @
1709e79c
...
@@ -22,8 +22,13 @@ import java.lang.annotation.Retention;
...
@@ -22,8 +22,13 @@ import java.lang.annotation.Retention;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
java.lang.annotation.Target
;
import
javax.servlet.ServletException
;
import
org.junit.After
;
import
org.junit.After
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.rules.ExpectedException
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
...
@@ -47,9 +52,13 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -47,9 +52,13 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* {@link SpringJUnit4ClassRunner}.
* {@link SpringJUnit4ClassRunner}.
*
*
* @author Dave Syer
* @author Dave Syer
* @author Sebastien Deleuze
*/
*/
public
class
BasicErrorControllerDirectMockMvcTests
{
public
class
BasicErrorControllerDirectMockMvcTests
{
@Rule
public
final
ExpectedException
thrown
=
ExpectedException
.
none
();
private
ConfigurableWebApplicationContext
wac
;
private
ConfigurableWebApplicationContext
wac
;
private
MockMvc
mockMvc
;
private
MockMvc
mockMvc
;
...
@@ -87,6 +96,15 @@ public class BasicErrorControllerDirectMockMvcTests {
...
@@ -87,6 +96,15 @@ public class BasicErrorControllerDirectMockMvcTests {
assertTrue
(
"Wrong content: "
+
content
,
content
.
contains
(
"status=999"
));
assertTrue
(
"Wrong content: "
+
content
,
content
.
contains
(
"status=999"
));
}
}
@Test
public
void
errorPageNotAvailableWithWhitelabelDisabled
()
throws
Exception
{
setup
((
ConfigurableWebApplicationContext
)
new
SpringApplication
(
WebMvcIncludedConfiguration
.
class
).
run
(
"--server.port=0"
,
"--error.whitelabel.enabled=false"
));
thrown
.
expect
(
ServletException
.
class
);
this
.
mockMvc
.
perform
(
get
(
"/error"
).
accept
(
MediaType
.
TEXT_HTML
));
}
@Target
(
ElementType
.
TYPE
)
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
@Documented
...
...
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