Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebTestClient.bindToRouterFunction(...) with exception handler not working [SPR-17239] #21772

spring-projects-issues opened this issue Sep 3, 2018 · 1 comment
in: test in: web type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Sep 3, 2018

rodolphocouto opened SPR-17239 and commented

This bug occurs when the WebTestClient is used to test a router function with custom exception handler, for example:


        .exceptionHandler(new CustomExceptionHandler()) // IS NOT CALLED :(



With annotated controllers, the same custom exception is called, for example:


    .bindToController(new MyController())
    .controllerAdvice(new CustomExceptionHandler()) // IS CALLED :)


Affects: 5.0.8

Reference URL:

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 12, 2018

Rossen Stoyanchev commented

Looks like several options in HandlerStrategies were added later, but bindToRouterFunction was never updated. This should be fixed now in master for 5.1.1.

@spring-projects-issues spring-projects-issues added in: test type: enhancement in: web labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.1.1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: test in: web type: enhancement
None yet

No branches or pull requests

2 participants