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
53e7484d
Commit
53e7484d
authored
Mar 19, 2019
by
Ali Dehghani
Committed by
Stephane Nicoll
Mar 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add error rendering support with @WebFluxTest
See gh-16266
parent
62d9c0a8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
spring.factories
...utoconfigure/src/main/resources/META-INF/spring.factories
+2
-1
ExampleWebExceptionHandler.java
...re/web/reactive/webclient/ExampleWebExceptionHandler.java
+4
-0
WebFluxTestAutoConfigurationIntegrationTests.java
...bclient/WebFluxTestAutoConfigurationIntegrationTests.java
+8
-0
No files found.
spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring.factories
View file @
53e7484d
...
@@ -100,7 +100,8 @@ org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration,\
...
@@ -100,7 +100,8 @@ org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration,\
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration,\
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration,\
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,\
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,\
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration,\
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration,\
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration,\
org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration
# AutoConfigureMockMvc auto-configuration imports
# AutoConfigureMockMvc auto-configuration imports
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc=\
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc=\
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleWebExceptionHandler.java
View file @
53e7484d
...
@@ -18,6 +18,8 @@ package org.springframework.boot.test.autoconfigure.web.reactive.webclient;
...
@@ -18,6 +18,8 @@ package org.springframework.boot.test.autoconfigure.web.reactive.webclient;
import
reactor.core.publisher.Mono
;
import
reactor.core.publisher.Mono
;
import
org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest
;
import
org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.server.ServerWebExchange
;
import
org.springframework.web.server.ServerWebExchange
;
...
@@ -27,8 +29,10 @@ import org.springframework.web.server.WebExceptionHandler;
...
@@ -27,8 +29,10 @@ import org.springframework.web.server.WebExceptionHandler;
* Example {@link WebExceptionHandler} used with {@link WebFluxTest} tests.
* Example {@link WebExceptionHandler} used with {@link WebFluxTest} tests.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @author Ali Dehghani
*/
*/
@Component
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
public
class
ExampleWebExceptionHandler
implements
WebExceptionHandler
{
public
class
ExampleWebExceptionHandler
implements
WebExceptionHandler
{
@Override
@Override
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAutoConfigurationIntegrationTests.java
View file @
53e7484d
...
@@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfigura
...
@@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfigura
import
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
;
import
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
;
import
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
;
import
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
;
import
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
;
import
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration
;
import
org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest
;
import
org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
...
@@ -37,6 +38,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
...
@@ -37,6 +38,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @author Artsiom Yudovin
* @author Artsiom Yudovin
* @author Ali Dehghani
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebFluxTest
@WebFluxTest
...
@@ -75,4 +77,10 @@ public class WebFluxTestAutoConfigurationIntegrationTests {
...
@@ -75,4 +77,10 @@ public class WebFluxTestAutoConfigurationIntegrationTests {
.
has
(
importedAutoConfiguration
(
ThymeleafAutoConfiguration
.
class
));
.
has
(
importedAutoConfiguration
(
ThymeleafAutoConfiguration
.
class
));
}
}
@Test
public
void
errorWebFluxAutoConfigurationIsImported
()
{
assertThat
(
this
.
applicationContext
)
.
has
(
importedAutoConfiguration
(
ErrorWebFluxAutoConfiguration
.
class
));
}
}
}
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